0
0
Pythonprogramming~5 mins

First Python Program (Hello World) - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the print() function in Python?
The print() function shows text or values on the screen. It helps us see the output of our program.
Click to reveal answer
beginner
Write the simplest Python code to display the message: Hello World
Use print("Hello World") to show the message on the screen.
Click to reveal answer
beginner
Why do we put text inside quotes in print()?
Quotes tell Python that the text is a message (string) to show exactly as it is.
Click to reveal answer
beginner
What happens if you forget the parentheses in print in Python 3?
Python will give an error because print is a function and needs parentheses to work.
Click to reveal answer
beginner
What is the output of this code?<br>
print("Hello World")
The output will be:<br>
Hello World
Click to reveal answer
Which Python function is used to display text on the screen?
Adisplay()
Bprint()
Cinput()
Dshow()
What will this code print?<br>
print("Hello")
Ahello
B"Hello"
CHello
Dprint("Hello")
In Python 3, what is missing in this code?<br>
print "Hello World"
AParentheses around print
BParentheses around the text
CQuotes around Hello World
DNothing is missing
Why do we use quotes inside print()?
ATo mark text as a message to print
BTo make the program faster
CTo add colors to text
DTo comment the code
What will happen if you run this code?<br>
print(Hello World)
AIt will print Hello World
BIt will print the word print
CIt will print nothing
DIt will cause an error
Explain how to write your first Python program that shows 'Hello World' on the screen.
Think about how to tell Python to show a message.
You got /4 concepts.
    What are common mistakes beginners make when writing the first Python program?
    Focus on syntax rules for the print function.
    You got /4 concepts.