[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Operators are used to perform operations on variables and values

2 / 40

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

3 / 40

3.

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

a. [ ]

b. { }

c. ( )

d. None of the above

4 / 40

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

5 / 40

5.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

6 / 40

6.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

7 / 40

7.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

14.

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

a. True

b. False

15 / 40

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

16 / 40

16.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. python file can also run on command line

22 / 40

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

23 / 40

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

24 / 40

24.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. A variable name cannot start with a number

30 / 40

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

31 / 40

31. Python has a set of built-in methods that you can use on lists/arrays

32 / 40

32.

Which is the correct operator for power(xy)?

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

33 / 40

33. Comments starts with a #

34 / 40

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

35 / 40

35.

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

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. You can also have an else without the elif

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.