
Quiz on Python
Quiz by Dr. Dishant Pandya
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
10 questions
Show answers
- Q1Which keyword is used to define a function in Python?functiondefifclass30s
- Q2What is the output of the following code? x = 'Hello' print(x[1:3])'lo''el''H''el'30s
- Q3Which data type is used to store a sequence of items in Python?liststringbooleaninteger30s
- Q4What is the purpose of the 'len()' function in Python?To return the number of items in a sequenceTo generate a random numberTo convert a string to uppercaseTo check if a file exists30s
- Q5What does the 'print()' function do in Python?Pause the program executionImport external librariesRead user input from the consoleOutput text or variables to the console30s
- Q6What does the 'append()' method do in Python lists?Remove the first element of the listAdd an element to the end of the listSort the elements of the list in ascending orderReturn the index of a specified element in the list30s
- Q7What is the result of the following expression: 5 + 2 * 3?211115930s
- Q8What does the 'range()' function in Python return?A boolean valueA sequence of numbersA stringA list of strings30s
- Q9What is the purpose of the 'if' statement in Python?To loop through a sequenceTo conditionally execute code based on a conditionTo declare a variableTo define a function30s
- Q10What is the syntax to import a module in Python?load module_nameimport module_nameinclude module_nameattach module_name30s