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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which operator is used to multiply numbers?
2. Look at the following code:age = "23"age = int(age)What does the int() function do to the data in my variable?
3. What is the output of the following python code?x=100def f1():global x x=90def f2():global x x=80print(x)
4. What is displayed to the screen when the following code runs? esports = ["Donkey Kong", "Galaga", "Pac Man"] esports.reverse() print(esports)
5. What will be the output of below Python code?list1=[8, 0, 9, 5]print(list1[::-1])
6. Koju verziju pythona koristimo?
7. Carrying out instructions is known as
8. What symbol is used to multiply two numbers together?
9. Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly show how to import and use the add() function? Select all that apply.
10. What is one of the main challenges in studying Burmese Pythons in the wild?
11. What does ..... init ..... do?
12. Which of the following is NOT a Python rule for naming functions?
13. Logical Operators:true if operand is false
14. What code would you use to get an average of your maths and English test results?
15. What is the purpose of comment lines in code?
16. >>>str="computer">>> str1='science'>>> str3=str+str1>>> print(str3)
17. How are variable length arguments specified in the function heading?
18. Print (name + '' is '' + age '' years old") This is an example of:
19. What is the order of precedence in python?i) Parentheses, ii) Exponentialiii) Multiplication, iv) Divisionv) Addition, vi) Subtraction
20. What is the index of the name 'Paula' in the following list:names = ["Paul", "Phillip", "Paula", "Phillipa"]
21. Identify the string membership operators of Python
22. Tracy always starts facing which direction?
23. The condition for a while loop to continue could include which of the following?
24. List1 = ["hello", "hey", "hi"]print(list1)How many items will be printed?
25. What will be the output shape of the following Python code?import turtlet=turtle.Pen()for i in range(1, 4):t.forward(60)t.left(90)
26. Select the correct operator for Exponentiation:
27. What is the output of the following code?for i in range(5, 0, -1):print(i)
28. Why is using lists beneficial?
29. What is the output of the following code?salary = 8000def printSalary():salary = 12000print("Salary:", salary)printSalary()print("Salary:", salary)
30. Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]Which of the following code will give the output as[4, 6, 8]
31. In programming, what is iteration/looping?
32. What symbol do you type in to add a short comment?
33. What will be the output of the following code?def max(a, b):if a > b:print('a is the max')else:print('b is the max')max(1, 2)
34. Which of the following operator is valid in Lists?
35. What computer science concept does something different depending on the situation?
36. Which of the following types of computer languages uses binary code to communicate with the computer?
37. A:Strings can be changed during executionB. Strings can be enclosed within single, double or even triple quotesC. Strings are immutable
38. What will:answer = input("Give me a number")print(answer * 5)output?
39. Which method is used to add a value at a specified position in the list?
40. The output of the following code is# program for addition of 2 numbersa = 10b = 3c = a + bprint("the sum is ", c)
41. Which function accepts all data as string or characters but not as numbers?
42. What are class variables?
43. Which character represents a comment in Python code?
44. ..... statement can also be used without specifying Exception.
45. How would we round the variable hourspermonth to 2 decimal places
46. Lists are used to store single item in a single variable.
47. A command that lets us repeat an action multiple times in your code
48. What is the syntax for creating a list in Python?
49. The expression int(x) implies that the variable x is converted to integer. State whether true or false.
50. Bundling two values together into one can be considered as
51. Which method is used to merge two lists?
52. What data type would store the value:Oranges
53. Numbers = [1, 3, 2, 4, 5]Which of the following code can output a sorted list without actually sorting the original list
54. What will be the output of the following code snippet? name1 = "jazz"name 2 = "madonna"if name1 != name2:print("No")else:print("Yes")
55. What is the output from the following code?print ("hello world")
56. Select the correct Operator for addition
57. Predict output for the following code snippet.print('No pain, no gain'.split('a'))
58. What is the average value of the code that is executed below?>>>grade1 = 80>>>grade2 = 90>>>average = (grade1 + grade2) / 2
59. Look at the following code:age = 23age = age * 2print (age)What is printed?
60. Anil is writing a "rock, scissors, paper" program. He wants the game to repeat until the user doesn't want to play anymore. What loop should he use?