NEW
Font size
WorksheetsGrade 6- PRINT statement in Python
Total questions: 10
Worksheet time: 5mins
What does the print() function do in Python?
Adds two numbers
Displays a message on the screen
Saves a file
Opens a webpage
What will be the output of the following code?
print("Hello, World!")
Hello World
Hello,World
Hello, World!
Hello! World!
Which of the following can be printed using the print() function?
Numbers only
Text only
Both numbers and text
Only emojis
What will be the output of this code?
print(5+3)
53
8
5+3
35
What happens if we write print( ) without anything inside the brackets?
It shows an error
It prints None
It prints a blank line
It prints Empty
Which of the following is correct syntax for a print statement?
a) print "Hello"
b) print(Hello)
c) print("Hello")
d) print("Hello" + )
What is the error in the following code?
print "Hello, World!"
Missing + between words
No error
Missing parentheses ( )
Extra space after print
Identify the error in this code:
print "Hello, World!"
a) Strings must be enclosed in quotes
b) print is spelled wrong
c) Missing a comma between Hello and World
d) No error
What is the error in this code?
print("The sum of 5 and 3 is:", 5, +, 3)
a) Extra comma after 5
b) The + symbol should not have commas around it
c) It should be print("The sum of 5 and 3 is:", 5 + 3)
d) No error
What will be the output of the following code?
a = 10
b = 20
print( a + b)
10
20
30
Error
