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
Program 1
a = "10" print(a * 2) print(int(a) * 2)
Program 2
print(type(8 / 4))
Program 3
print(int("3.5"))
Program 4
x = 5 y = x x = x + 1 print(x, y)
Program 5
print(bool("False"), bool(""), bool(0.0))
Program 6
print("Level", 3, sep=": ")
Program 7
age = "15" print(age + 1)
Program 8
print(int(-2.7), float(4))