Challenge - 5 Problems
Hello World Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:00remaining
What is the output of this Python code?
Look at this simple program. What will it print when run?
Python
print('Hello World!')
Attempts:
2 left
💡 Hint
Remember, print shows exactly what is inside the quotes.
✗ Incorrect
The print function outputs the exact string inside the quotes, including spaces and capitalization.
❓ Predict Output
intermediate1:00remaining
What will this code print?
This program prints two lines. What is the output?
Python
print('Hello') print('World!')
Attempts:
2 left
💡 Hint
Each print prints on a new line.
✗ Incorrect
Each print statement outputs text and moves to a new line, so the output is two lines: Hello and World!
❓ Predict Output
advanced1:30remaining
What error does this code raise?
Look at this code. What error will it cause when run?
Python
print('Hello World!') print('Again')
Attempts:
2 left
💡 Hint
Two statements must be on separate lines or separated by a semicolon.
✗ Incorrect
Python requires statements on separate lines or separated by semicolons. Writing two print statements on the same line without a separator causes SyntaxError.
❓ Predict Output
advanced1:00remaining
What is the output of this code?
What will this program print?
Python
message = 'Hello World!' print(message)
Attempts:
2 left
💡 Hint
Variables hold values that print without quotes.
✗ Incorrect
The variable message stores the string. print(message) outputs the string value without quotes.
🧠 Conceptual
expert1:30remaining
Which option will cause an error when running this code?
Consider these four print statements. Which one will cause an error?
Attempts:
2 left
💡 Hint
Strings must be inside quotes to print correctly.
✗ Incorrect
Option D tries to print words without quotes, causing invalid syntax and raises a SyntaxError.