[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Indentation refers to the spaces at the beginning of a code line.

2 / 40

2.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

3 / 40

3. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

4 / 40

4. To write and execute code in python, we first need to install Python on our system.

5 / 40

5. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

6 / 40

6. Variable names are case-sensitive

7 / 40

7. Variables that are created outside of a function

8 / 40

8. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

9 / 40

9.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

10 / 40

10.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

11 / 40

11. Strings in python are surrounded by either single quotation marks, or double quotation marks

12 / 40

12. You can also have multiple else statements on the same line:

13 / 40

13. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

14 / 40

14. During Installation Make sure to select both the checkboxes at the bottom .

15 / 40

15.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

16 / 40

16.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

17 / 40

17. With the break statement we can stop the loop even if the while condition is true

18 / 40

18. Python can be install on both  Linux and  Windows

19 / 40

19. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

20 / 40

20. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

21 / 40

21. Camel Case
Each word, except the first, starts with a capital letter:

22 / 40

22. + operator is used  to get output of multiple variables

23 / 40

23. Comparison operators are not  used to compare two values

24 / 40

24.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

25 / 40

25. A variable name must start with a letter or the underscore character

26 / 40

26. Which of the following is the correct extension of the Python file?

27 / 40

27.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

28 / 40

28.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

29 / 40

29.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

30 / 40

30. The else keyword catches anything which isn’t caught by the preceding conditions.

31 / 40

31. To insert characters that are illegal in a string, use an escape character

32 / 40

32. Comments can be used to make the code more readable.

33 / 40

33.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

34 / 40

34. print() function is often used to output variables.

35 / 40

35. Python allows you to extract the values into variables.

36 / 40

36. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

37 / 40

37. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

38 / 40

38. Python will give you an error if you skip the indentation

39 / 40

39. With the break statement we can stop the loop before it has looped through all the items

40 / 40

40. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.