[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

2 / 40

2. Python relies on indentation?

3 / 40

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

4 / 40

4. Python can be used on a server to create web applications?

5 / 40

5.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

6 / 40

6.

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

7 / 40

7. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

8 / 40

8. Python can be treated in a procedural way, an object-oriented way or a functional way.

9 / 40

9. python file can also run on command line

10 / 40

10. The length of an array is always one more than the highest array index.

11 / 40

11. Bitwise operators are used to compare (binary) numbers

12 / 40

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

13 / 40

13.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

14 / 40

14. Arithmetic operators are used with numeric values to perform common mathematical operations

15 / 40

15. Comments can be used to explain Python code.

16 / 40

16. Extension of all Python  Programme are .py

17 / 40

17.

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

18 / 40

18.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

19 / 40

19.

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

20 / 40

20.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

21 / 40

21. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

22 / 40

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

23 / 40

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

24 / 40

24.

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

25 / 40

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

26 / 40

26. Python can connect to database systems.

27 / 40

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

28 / 40

28. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

29 / 40

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

30 / 40

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

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 can be install on both  Linux and  Windows

33 / 40

33. You can also use the remove() method to remove an element from the array

34 / 40

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

35 / 40

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

36 / 40

36.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

37 / 40

37. Most recent major version of Python is Python 3

38 / 40

38. Python has various versions available

39 / 40

39. The format() method takes unlimited number of arguments

40 / 40

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

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.