Hands-on Computer Science
My learning DE

Quiz10 min

Quiz: First programs

Eight questions on values, variables, text, calculating, lists and your own functions in Python.

Topics:Programming with Python

What does print("3" + "4") print?

  • 7
  • 34
  • An error message, because text cannot be added

Someone types the number 19 at age = input("Age? "). What type does age have?

  • int
  • float
  • str

What do 17 // 5 and 17 % 5 return?

  • 3.4 and 0
  • 3 and 2
  • 3 and 0.4
  • 2 and 3

Which of these can be the name of a variable in Python? (several are right)

  • total_price
  • 2nd_place
  • my-name
  • seconds_per_day
  • class

What does print(colors[1]) print if colors = ["red", "green", "blue"]?

  • red
  • green
  • blue

What does this program print?

numbers = [3, 8, 1]
numbers.append(5)
print(len(numbers), max(numbers), sorted(numbers)[0])
  • 3 8 3
  • 4 8 1
  • 4 5 1
  • 4 8 3

What value does result have at the end?

def double(number):
    print(number * 2)


result = double(4)
  • 8
  • "8"
  • None

A program stops with NameError: name 'totl' is not defined. What most likely happened?

  • Python is too old for this program.
  • A name is misspelt, or the variable has no value yet at this point.
  • A number was divided by zero.

Download with answers: CSV Anki

Back
More on this
Details
Level
Beginner
Modules
Digitization and Programming
In learning paths
Python for beginners
Code
4381
Updated
1 November 2026
Status
published

    A four-digit code takes you straight to the item.