placeholder image to represent content

Python Quiz

Quiz by Namaivayam M

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
16 questions
Show answers
  • Q1
    What do we use to define a block of code in Python language?
    None of these
    Brackets
    Indentation
    Key
    30s
  • Q2
    What will be the output of the program? x = 1 while True: if x % 5 == 0: break print(x) x + = 1
    2 1
    None of these
    error
    0 3 1
    30s
  • Q3
    For 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 correct
    Only C and D are correct
    Only A is correct
    All are correct
    30s
  • Q4
    What will be the output of the following code? x = 'pqrs' for i in range(len(x)): x[i].upper() print (x)
    PQRS
    None of these
    qrs
    pqrs
    30s
  • Q5
    When Python is dealing with identifiers, is it case sensitive?
    Can’t say
    Yes
    No
    Machine dependent
    30s
  • Q6
    The built-in function in Python is:
    Factorial()
    Print ()
    Seed ()
    Sqrt ()
    30s
  • Q7
    In 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
  • Q8
    In Python, find which one isn’t an exception handling keyword.
    except
    finally
    accept
    try
    30s
  • Q9
    Which statement do you use to create a class in Python?
    class MyClass
    Option 1
    create MyClass
    def MyClass
    30s
  • Q10
    What is the purpose of the “return” statement in Python?
    To create a new function
    To return a value from a function
    To exit a function
    To exit a loop
    30s
  • Q11
    What is the correct syntax for creating a function in Python?
    create my_function():
    function my_function():
    new my_function():
    def my_function():
    30s
  • Q12
    What is the function of ‘self’ in Python class?
    It is used to define a variable
    It is used to define a class
    It is used to reference an instance of a class
    It is used to define a function
    30s
  • Q13
    What is a dictionary in Python?
    A string of characters
    A set of integers
    A list of tuples with unique keys
    A collection of values stored in key-value pairs
    30s
  • Q14
    What is the function of the "pass" statement in Python?
    It is used to indicate that a block of code is intentionally left empty
    It is used to repeat the current iteration
    It is used to stop the execution of the loop and move on to the next statement after the loop
    It is used to skip the current iteration and move to the next iteration
    30s
  • Q15
    What is the result of the following expression: 'abc' * 3?
    'abc'
    'abcabc'
    'abcabcabc'
    'abccba'
    30s

Teachers give this quiz to your class