[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python relies on indentation?

2 / 40

2.

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

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

3 / 40

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

4 / 40

4. A variable name can only contain alpha-numeric characters and
underscores

5 / 40

5. Python can be install on both  Linux and  Windows

6 / 40

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

7 / 40

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

8 / 40

8. An array is a special variable, which can hold more than one value at a time

9 / 40

9.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

10 / 40

10.

 What is output of: 35 == 35.0

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

11 / 40

11.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

12 / 40

12.

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

13 / 40

13.

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

14 / 40

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

15 / 40

15. Comments can be used to explain Python code.

16 / 40

16. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

17 / 40

17. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

18 / 40

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

19 / 40

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

20 / 40

20. Python is an interpreted programming language

21 / 40

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

22 / 40

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

23 / 40

23. You can have if statements inside if statements, this is called nested if statements.

24 / 40

24. Pip is  not a powerful package management system for Python software packages

25 / 40

25.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

26 / 40

26. Variables that are created outside of a function

27 / 40

27. You can use the append() method to add an element to an array

28 / 40

28. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

29 / 40

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

30 / 40

30. Comparison operators are not  used to compare two values

31 / 40

31. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

32 / 40

32. An array can hold many values under a single name

33 / 40

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

34 / 40

34. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

35 / 40

35. Most recent major version of Python is Python 3

36 / 40

36. The list’s remove() method only removes the first occurrence of the specified value.

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Python has various versions available

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.