[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

4 / 40

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

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 is the correct operator for power(xy)?

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

7 / 40

7.

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

8 / 40

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

9 / 40

9. Python has various versions available

10 / 40

10.

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

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

14 / 40

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

15 / 40

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

16 / 40

16. 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”

17 / 40

17. The format() method takes the passed arguments

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

What is the value of the expression 100 / 25?

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

22 / 40

22. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. Python relies on indentation?

27 / 40

27. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

28 / 40

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

29 / 40

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

30 / 40

30.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. You can also have an else without the elif

40 / 40

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

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.