Class 11 Computer Science Chapter 9 Practical Work Python Exercises Quiz 2 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. Choose the correct data type:Age (in whole years)Example:17
2. What data type would store the value:6.4?
3. If you want to create an empty list called colours, which of the following pieces of code is correct?
4. Choose the correct data type:"K"
5. Drink ..... choices = ["coffee", "tea", "water", "juice", "soda"]for drink in drink ..... choices:print(drink)
6. What are Strings?
7. What will be the output of the following Python expression? round(4.5676, 2)?
8. ..... data type contain integer values with no decimal such as 1, 200, 999 etc.
9. What is the condition in this code?if name == "Catherine":print("Hello, '' + name)
10. What type of programming language is Python?
11. Numbers = [1, 2, 3, 4, 5]print ( numbers.pop() )The program above prints
12. What is printed?cheer = "Go Eagles!"print cheer[0:1]
13. L=[2, 4, 8, 16, 32, 64] what is L[:2]
14. Who is the inventor of python language?
15. Which symbol surrounds a dictionary?
16. Which of the following commands will return the length of the list mylist?
17. If the return statement is not used inside the function, the function will return:
18. The datatype whose representation is unknown are called
19. Please select all correct ways to empty the following dictionarystudent = { "name": "Emma", "class":9, "marks":75 }
20. Consider the code and What is the result?s='AB CD'list=list(s)list.append('EF')print(list)
21. In Python, what are if-statements used for?
22. In a list called "players", if you wanted to add a player called "Bob" to the list, which of the following examples of code would be correct?
23. What button do you press to run your program?
24. Which of the following are not sequences supported in Python?
25. What error will occur when you execute the following code? MANGO = APPLE
26. Given the nested if-else below, what will be the value x when the code executed successfullyx = 0a = 5b = 5if a > 0:if b < 0:x = x + 5 elif a > 5:x = x + 4 else:x = x + 3else:x = x + 2print(x)
27. ..... method adds a single item to the end of the list.
28. Which symbol is used to print more than one item on a single line?
29. The command that will print a line of command on the program is:
30. Choose the correct data type:6
31. How do you define the range of a for loop in Python?
32. The datatype whose representation is known are called
33. What is the window called where you write your code?
34. NameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]The list will be slice and show Harry and Jesse only. Which piece of code below would do this?
35. Presenting the results back to a user is known as
36. Enemy = hero.findNearestEnemy( )What is findNearestEnemy( )?
37. Which of these codes is correct for creating a list of numbers?
38. Which of the following statements correctly defines a function named "haunted" that takes a parameter named "apple" ?
39. Str="world of python programming"len(str)
40. What can be used to store information and values so that it can be used later?
41. Which of the following is not a keyword?
42. What is missing in the square braces?cheer = "Go Eagles!"print cheer[ ]If the output is Eagle
43. Output of the following question is:#program for text addition# input() methodf ..... name= "hello"l ..... name ="world"print( f ..... name + l ..... name)
44. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]Which of the following code gives the following list as the output[4, 5, 6]
45. Concatenation is a ..... operator.
46. What is the output of program below?mariana ..... islands = ['Saipan', 'Tinian', 'Rota']mariana ..... islands[0] = 'Guam'print(mariana ..... islands)
47. A dictionary is an example of a sequence .....
48. Booleans represent one of two values:True or False.
49. Inside a function with two parameters, print the first parameter. def my ..... function(fname, lname):print( ..... )
50. What do we use at the start of a comment line?
51. In which language is Python written?English
52. When you read code carefully to look for errors and fix them
53. A count controlled loop will .....
54. What is the order of precedence in Python?i. Parenthesisii. Exponentialiii. Multiplicationiv. Divisionv. Additionvi. Subtraction
55. Choose the correct data type:240.00
56. Which data type is used to store decimal numbers in Python?
57. What will the output be from the following code?print("Hello" + str(2) + "world!")
58. A condition controlled loop is .....
59. What is the index number for 'Spain'?['England', 'Brazil', 'Spain', 'France']
60. Choose the correct alternative out of the following