[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. You can also have an else without the elif

7 / 40

7.

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

8 / 40

8. A variable name cannot start with a number

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

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

13 / 40

13.

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

a. [ ]

b. { }

c. ( )

d. None of the above

14 / 40

14. The len() method to return the length of an array

15 / 40

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

16 / 40

16.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

17 / 40

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

18 / 40

18.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

19 / 40

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

20 / 40

20. Most recent major version of Python is Python 3

21 / 40

21. Python can connect to database systems.

22 / 40

22.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

23 / 40

23.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

24 / 40

24. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

25 / 40

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

26 / 40

26. Python can be install on both  Linux and  Windows

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

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

29 / 40

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

30 / 40

30.

 What is output of: 35 == 35.0

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

31 / 40

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

32 / 40

32.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

33 / 40

33. Arrays are used to store multiple values in one single variable.

34 / 40

34. You can use the pop() method to remove an element from the array

35 / 40

35. Python is a  high-level programming language.

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Official site of python is www.python.org

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.