
Programming and Python
Quiz by Mrs Grimmond
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
20 questions
Show answers
- Q1What is the output of the following Python code: print(type([]))?30s
- Q2Which of the following is a valid way to define a function in Python?function my_function():create my_function():define my_function(){}def my_function():30s
- Q3What is the result of the following Python expression: 5 * 2 + 3?168131030s
- Q4What does the 'len()' function do in Python?It converts an object to a string.It counts the number of unique items in a list.It returns the length of an object.It creates a new list.30s
- Q5Which of the following correctly imports the 'math' module in Python?require mathusing mathimport mathinclude math30s
- Q6What is the output of the following code snippet: print(3 == 3.0)?TrueErrorFalseNone30s
- Q7What keyword is used to create a loop that repeats a block of code a specific number of times in Python?forwhilerepeatloop30s
- Q8Which of the following methods can be used to add an element to a list in Python?append()push()insert()add()30s
- Q9What will be the output of the following Python code: print('Hello' + 'World')?Hello WorldHelloWorldHello+WorldError30s
- Q10Which of the following statements correctly creates a dictionary in Python?my_dict = ['key', 'value']my_dict = {'key': 'value'}my_dict = ('key', 'value')my_dict = key: value30s
- Q11Which of the following is a valid way to create a list in Python?[1, 2, 3]1, 2, 3{1, 2, 3}(1, 2, 3)30s
- Q12What is the result of the following Python expression: 5 // 2?32.51230s
- Q13What does the 'def' keyword do in Python?It defines a loop.It defines a function.It defines a variable.It defines a class.30s
- Q14What is the purpose of the 'import' statement in Python?To define loops.To include external modules or libraries.To declare variables.To create functions.30s
- Q15Which of the following is the correct way to create a dictionary in Python?(key1: value1, key2: value2)['key1': 'value1', 'key2': 'value2']{key1, value1, key2, value2}{'key1': 'value1', 'key2': 'value2'}30s