WorksheetsUser Input in Python
Total questions: 5
Worksheet time: 4mins
Name
Class
Date
1.
What function do you need to call to ask the user of the program to enter text?
a)
input()
b)
read()
c)
text()
d)
print()
2.
After a program takes information from a user, where is this information typically stored?
a)
In a database.
b)
In a variable.
c)
In a separate file.
d)
In the program's output console.
3.
What type does input() return by default?
a)
Integer
b)
Float
c)
String (text)
d)
Boolean
4.
Which function can be used to convert a string (text) received from user input into an integer, allowing for mathematical operations?
a)
str()
b)
float()
c)
convert()
d)
int()
5.
Which line of code correctly stores a number entered by the user?
a)
num = input("Enter number: ")
b)
num = int(input("Enter number: "))
c)
num = str(input("Enter number: "))
d)
num = float()
100 %
