
Python Quiz
Quiz by Namaivayam M
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
16 questions
Show answers
- Q1What do we use to define a block of code in Python language?None of theseBracketsIndentationKey30s
- Q2What will be the output of the program? x = 1 while True: if x % 5 == 0: break print(x) x + = 12 1None of theseerror0 3 130s
- Q3For tuples and list which is correct? A - List and tuples both are mutable. B - List is mutable whereas tuples are immutable. C - List and tuples both are immutable. D - List is immutable whereas tuples are mutable.Only B is correctOnly C and D are correctOnly A is correctAll are correct30s
- Q4What will be the output of the following code? x = 'pqrs' for i in range(len(x)): x[i].upper() print (x)PQRSNone of theseqrspqrs30s
- Q5When Python is dealing with identifiers, is it case sensitive?Can’t sayYesNoMachine dependent30s
- Q6The built-in function in Python is:Factorial()Print ()Seed ()Sqrt ()30s
- Q7In the following statements of Python, which ones will result into the output: 6? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]A[3][2]A[2][1]A[2][3]A[1][2]30s
- Q8In Python, find which one isn’t an exception handling keyword.exceptfinallyaccepttry30s
- Q9Which statement do you use to create a class in Python?class MyClassOption 1create MyClassdef MyClass30s
- Q10What is the purpose of the “return” statement in Python?To create a new functionTo return a value from a functionTo exit a functionTo exit a loop30s
- Q11What is the correct syntax for creating a function in Python?create my_function():function my_function():new my_function():def my_function():30s
- Q12What is the function of ‘self’ in Python class?It is used to define a variableIt is used to define a classIt is used to reference an instance of a classIt is used to define a function30s
- Q13What is a dictionary in Python?A string of charactersA set of integersA list of tuples with unique keysA collection of values stored in key-value pairs30s
- Q14What is the function of the "pass" statement in Python?It is used to indicate that a block of code is intentionally left emptyIt is used to repeat the current iterationIt is used to stop the execution of the loop and move on to the next statement after the loopIt is used to skip the current iteration and move to the next iteration30s
- Q15What is the result of the following expression: 'abc' * 3?'abc''abcabc''abcabcabc''abccba'30s