NEW
Font size
WorksheetsU2/L3 Kira HS
Total questions: 20
Worksheet time: 10mins
What is the purpose of a comment in Python code?
To execute a line of code
To store data
To help understand the code
To create a loop
Which symbol is used to start a comment in Python?
$
#
@
&
What is the output of the following Python statement: print('Hello, Python!')?
Hello, World!
Hello, Python!
'Hello, Python!'
Error
What type of error occurs when there is a mistake in the syntax of the code?
Logical error
Runtime error
Syntax error
Semantic error
Which of the following is an arithmetic operation in Python?
Concatenation
Division
Assignment
Comparison
What should you do if your code has typos, missing symbols, or incorrect formatting?
Ignore the errors and run the code again.
Check your code carefully and fix the errors.
Add more print statements.
Change the programming language.
How do print statements and arithmetic help in coding?
They make the code run faster.
They allow you to give instructions and see results.
They automatically fix errors in the code.
They change the code's language.
Why is it useful to include comments in your code, even if the computer doesn’t read them?
To make the code run faster
To help other programmers understand the code
To increase the file size
To confuse the compiler
What should you do when your code gives you a syntax error?
Ignore the error and continue coding
Check the code for typos or missing elements
Restart the computer
Delete the entire code
How does using print statements and arithmetic in Python help you communicate with the computer?
They allow you to create graphics
They enable you to perform calculations and display results
They are used to write comments
They help in saving files
In the "Your Turn with Numbers!" activity, you used Python to solve problems using ____________ operations.
Logical
Arithmetic
String
Boolean
Some examples of arithmetic operations in Python include addition, subtraction, multiplication, and division. Which of the following is NOT an arithmetic operation in Python?
Addition
Subtraction
Concatenation
Multiplication
A ____________ ____________ is a mistake in the code that prevents it from running correctly.
Syntax error
Logic error
Runtime error
Semantic error
One example of a syntax error is forgetting to close a ____________ or missing a ____________ in a print statement.
Parenthesis, quotation mark
Bracket, semicolon
Quotation mark, parenthesis
Curly brace, colon
In the "Making Mistakes!" section, you learned that errors are a normal part of ____________ and can help you learn and improve.
Programming
Gardening
Cooking
Painting
A _______________ _______________ is a command in Python used to display text or output to the console.
print statement
input statement
if statement
while loop
A _______________ is a non-executable line in the code that helps explain or document what the code is doing.
comment
variable
function
loop
In Python, you create a comment by starting the line with a _______________ symbol.
#
$
@
%
When writing code, it’s important to use comments to make your code easier to _______________ and _______________.
read, understand
compile, execute
delete, ignore
encrypt, decrypt
In the "Your Turn!" activity, you practiced using _______________ _______________ to communicate with the computer.
print statements
input devices
mouse clicks
binary code
