[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

3. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

4 / 40

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

5 / 40

5. A variable name cannot start with a number

6 / 40

6.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

7 / 40

7. Pascal Case
Each word starts with a capital letter:

8 / 40

8. 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

9 / 40

9. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

10 / 40

10.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

11 / 40

11.

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

12 / 40

12.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

13 / 40

13.

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

a. Define

b. DEF

c. def

d. Def

14 / 40

14. 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

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

16. The for loop does not require an indexing variable to set beforehand

17 / 40

17.

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

a. 2

b. 3

c. 5

d. Multiple times

18 / 40

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

19 / 40

19. Comments can’t be used to prevent execution when testing code.

20 / 40

20. 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

21 / 40

21. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

22 / 40

22. With the for loop we can execute a set of statements

23 / 40

23. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

24 / 40

24. Python can be used to handle big data and perform complex mathematics.

25 / 40

25.

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

a. True

b. False

26 / 40

26.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

27 / 40

27. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

28 / 40

28. Comments can be used to explain Python code.

29 / 40

29. python has two primitive loop commands:

  • while loops
  • for loops

30 / 40

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

31 / 40

31. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

32 / 40

32. Python is a  high-level programming language.

33 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

34 / 40

34. You can also have an else without the elif

35 / 40

35. Python has various versions available

36 / 40

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

37 / 40

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

38 / 40

38.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

39 / 40

39. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

40 / 40

40.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

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.