Python Tests / Quizes (original) (raw)

Python hosting: Host, run, and code Python in the cloud!

If you finished the Python beginner series, you could do this quiz to test your understanding of Python. Don’t worry, more tutorials are being created on a weekly and sometimes daily basis.
We hope you like our tutorials and enjoy the quizes!

Related Course: Python Programming Bootcamp: Go from zero to hero


Python Beginner Quiz

0 of 20 questions completed

Questions:

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20

Information

A quiz to understand your understanding of Python. This quiz only covers parts of the beginners series and not all of the topics covered on this site including variables, functions, classes, objects and many more. We recommend you do the beginner series first if you have not done so yet.

The quiz consists of 20 questions.

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading...

You must sign in or sign up to start the quiz.

You have to finish following quiz, to start this quiz:

0 of 20 questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 points, (0)

Categories

  1. Not categorized 0%
  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

  6. 6

  7. 7

  8. 8

  9. 9

  10. 10

  11. 11

  12. 12

  13. 13

  14. 14

  15. 15

  16. 16

  17. 17

  18. 18

  19. 19

  20. 20

  21. Answered

  22. Review

  23. Question 1 of 20
    1 points
    Which function displays a message on the screen in Python?

    • sys.out.println()
    • print()
    • writeln()
    • console.writeln()
  24. Question 2 of 20
    1 points
    How do we get a variable from the command line?

    • cin << "Enter message";
    • input("Enter message")
    • console.read("Enter message")
    • system.readline("Enter message")
  25. Question 3 of 20
    1 points
    Which of these prints the length of a string s?

    • print len(s)
    • print s.length()
    • print s.len()
    • print string.length(s)
  26. Question 4 of 20
    1 points
    If we have a list x [1,2,3,4], how do we print the first element?

    • print x[0]
    • print x[1]
    • print x.first()
    • print x(0)
  27. Question 5 of 20
    1 points
    How do we remove an element from a list?

    • list.delete()
    • list.delete(-1)
    • list.remove()
    • list.remove(-1)
  28. Question 6 of 20
    1 points
    Which operator is used to compare two numbers for equality?

    • =
    • ==
    • !=
    • +=
  29. Question 7 of 20
    1 points
    How can we define a function in Python?

    • int add(int a, int b):
    • method add(int a, int b):
    • def add(a,b):
  30. Question 8 of 20
    1 points
    Which is the correct output for :
    for i in range(1,10):
    print(i)

    • 1,2,3,4,5,6,7,8,9
    • 1,2,3,4,5,6,7,8,9,10
    • 0,1,2,3,4,5,6,7,8,9,10
    • 1,2,3,4,5,6,7,8
  31. Question 9 of 20
    1 points
    What is the binary number 00001010 in decimal?

    • 4
    • 16
    • 32
    • 10
  32. Question 10 of 20
    1 points
    Should you use recursion for factorial?

  1. Question 11 of 20
    1 points
    Check the correct box
  1. Question 12 of 20
    1 points
    What is inheritance used for?
  1. Question 13 of 20
    1 points
    True or false, a dictionary is always in order.
  1. Question 14 of 20
    1 points
    If User is a class, how do we make a new User object?
  1. Question 15 of 20
    1 points
    An object can contain:
  1. Question 16 of 20
    1 points
    When would you use a while loop?
  1. Question 17 of 20
    1 points
    What is a nested loop?
  1. Question 18 of 20
    1 points
    How can you include a module in Python?
  1. Question 19 of 20
    1 points
    How to find your Python version?
  1. Question 20 of 20
    1 points
    True or false, a function can be defined inside a function

Python Beginner Quiz 2

0 of 10 questions completed

Questions:

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10

Information

Another Python quiz to test your knowledge of Python for the beginners series. The quiz includes some general questions on the Python programming langage.
You may be surprised to find some of the answers.

The test Consists of 10 questions.

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading...

You must sign in or sign up to start the quiz.

You have to finish following quiz, to start this quiz:

0 of 10 questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 points, (0)

Categories

  1. Not categorized 0%

  2. 1

  3. 2

  4. 3

  5. 4

  6. 5

  7. 6

  8. 7

  9. 8

  10. 9

  11. 10

  12. Answered

  13. Review

  14. Question 1 of 10
    Who originally created Python?

    • Bram Moolenaar
    • Guido van Rossum
    • David Lee
    • Bill Joy
  15. Question 2 of 10
    Which of these is not a Python datatype?

    • int
    • long
    • decimal
    • float
  16. Question 3 of 10
    How can we add two strings together?

    • s.join(s2)
    • s.add(s2)
    • s = s + s2
    • s ++ s2
  17. Question 4 of 10
    How can we create a newline in a print function?

    • \\
    • \"
    • \t
    • \n
  18. Question 5 of 10
    Which is not a valid Python loop?

    • for loop
    • while loop
    • iter loop
  19. Question 6 of 10
    What is a nested loop?

    • a loop without condition
    • a loop called from an object
    • a loop inside a loop
    • a recursive loop
  20. Question 7 of 10
    How to access list elements?

    • print l->get(0)
    • print l.item(0)
    • print l(0)
    • print l[0]
  21. Question 8 of 10
    When was Python first created?

    • 1991
    • 1995
    • 2000
    • 2005
  22. Question 9 of 10
    Does python support object oriented programming?

    • No
    • Yes
  23. Question 10 of 10
    Does Python have support for random numbers?