[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

2 / 40

2.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

3 / 40

3.

What is the value of the expression 100 / 25?

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

4 / 40

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

5 / 40

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

6 / 40

6. Strings in python are surrounded by either single quotation marks, or double quotation marks

7 / 40

7.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

8 / 40

8. Python is a  high-level programming language.

9 / 40

9. The format() method takes the passed arguments

10 / 40

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

11 / 40

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

12 / 40

12. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

13 / 40

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

14 / 40

14. We can combine strings and numbers by using the format() method

15 / 40

15.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

21 / 40

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

22 / 40

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

23 / 40

23.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

24 / 40

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

25 / 40

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

26 / 40

26. A variable name cannot start with a number

27 / 40

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

a. 5

b. 3

c. 6

d. 7

28 / 40

28. Python allows you to extract the values into variables.

29 / 40

29.

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

30 / 40

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

31 / 40

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

32 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

33 / 40

33. 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()

 

34 / 40

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

35 / 40

35.

 Select the correct example of complex datatype in Python

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

36 / 40

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

37 / 40

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

38 / 40

38.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

39 / 40

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

40 / 40

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

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.