QuizzesPython Basics for Backend Development
beginner
python

Python Basics for Backend Development

A quiz to test your understanding of basic Python concepts essential for backend development.

15 minutes 15 questions Pass at 70%
Time Limit
15 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

15 questions on Python Basics for Backend Development. Work through them here, then start the quiz to answer them and see your score.

  1. 1.What is the output of the following code snippet? `print(type(5))`

    • A<class 'float'>
    • B<class 'int'>
    • C<class 'list'>
    • D<class 'str'>
  2. 2.Which of the following is a mutable data type in Python?

    • Atuple
    • Bstring
    • Clist
    • Dint
  3. 3.What is the correct way to define a function in Python?

    • Adef myFunc():
    • Bdefine myFunc():
    • Cfunc myFunc():
    • Dfunction myFunc():
  4. 4.How do you start a comment in Python?

    • A/*
    • B#
    • C//
    • D<!--
  5. 5.What will be the output of `print(2 ** 3)`?

    • A9
    • B8
    • C6
    • D16
  6. 6.Which of the following is used to handle exceptions in Python?

    • Atry-except
    • Btry-catch
    • Ccatch-throw
    • Dhandle-except
  7. 7.What is the output of `print('Hello' + 'World')`?

    • AHello World
    • BHello+World
    • CHello World!
    • DHelloWorld
  8. 8.Which keyword is used to create a class in Python?

    • Adef
    • Bclass
    • Cobject
    • Dstruct
  9. 9.What is the output of `print(len('Python'))`?

    • A6
    • B8
    • C5
    • D7
  10. 10.Which of the following is NOT a valid variable name in Python?

    • A_var
    • Bvar_2
    • Cmy_var
    • D2ndVar
  11. 11.What will be the output of `print(10 // 3)`?

    • A3
    • B3.0
    • C3.333
    • D4
  12. 12.Which of the following is a valid way to import a module in Python?

    • Aimport math
    • Busing math
    • Cinclude math
    • Drequire math
  13. 13.What is the output of `print(bool(0))`?

    • A0
    • BTrue
    • CFalse
    • DNone
  14. 14.Which of the following is used to iterate over a sequence in Python?

    • Aloop
    • Biterate
    • Cfor
    • Drepeat
  15. 15.What is the output of `print('Python'[0])`?

    • AP
    • By
    • Cn
    • DPython