Python Input & Output Quiz
1. What function is used to display output in Python?
show()
display()
print()
output()
2. What type of value does input() always return?
Integer
Float
Boolean
String
3. What will this code print?
print("Hello", "World")
HelloWorld
Hello, World
Hello World
"Hello" "World"
4. Which function is used to get user input?
get()
read()
scan()
input()
5. How do you convert user input to an integer?
integer(input())
int(input())
input(int)
convert(input)
6. What will happen if you add a number to input without converting it?
It will work normally
Python will guess the type
A TypeError will occur
The program will ignore the number
7. What is an f-string used for?
Looping through data
Formatting strings with variables
Getting input
Creating functions
8. Which is a correct f-string?
print("{name} is 20")
print(f"{name} is 20")
print(f"name is 20")
print(f{name} is 20)
9. What will this code do?
age = int(input("Age: "))
Print the age
Store the age as a string
Store the age as an integer
Cause an error always
10. Which line correctly combines input and output?
print(input)
input(print("Name:"))
name = input("Name: "); print(name)
input = print("Name")
Submit Quiz