24. Code
Result
s = input('What is the year?')
y = int(s)
print(y)
The input function
displays the
prompt
What is the year?
25. Code
Result
s = input('What is the year?')
y = int(s)
print(y)
User types in a string
which represents a
number
What is the year?
1066
26. Code
Result
s = input('What is the year?')
y = int(s)
print(y) The int function
converts the string
to a number
What is the year?
1066
1066 print displays it
44. Code
Result
print('You are in the haunted library. There')
print('is a book of spells on the table.')
s = input()
You are in the haunted library. There
is a book of spells on the table.