Editor

Python Basics: What Does This Print

What does this print? · Beginner · about 6 min

Read each short program and type exactly what it prints, with each printed line on its own line. If a program stops with an error, type the error's name, like TypeError.

Example

name = "Mia"
print("Hi", name, 5 + 1)

prints

Hi Mia 6
  1. Program 1

    a = "10"
    print(a * 2)
    print(int(a) * 2)
  2. Program 2

    print(type(8 / 4))
  3. Program 3

    print(int("3.5"))
  4. Program 4

    x = 5
    y = x
    x = x + 1
    print(x, y)
  5. Program 5

    print(bool("False"), bool(""), bool(0.0))
  6. Program 6

    print("Level", 3, sep=": ")
  7. Program 7

    age = "15"
    print(age + 1)
  8. Program 8

    print(int(-2.7), float(4))