wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz: Print, Syntax and Comments in Python

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

What are the three main parts of the Repl Environment?

a)

The Sidebar, The Editor, The Console/Terminal

b)

The Sidebar, The Package Manager, The Debugger

c)

The Editor, The Console/Terminal, The Repl Environment

d)

The Repl Environment, The IDLE, The Code Box

2.

What is the purpose of the print() command?

a)

To write code in the Editor

b)

To interact with the Console/Terminal

c)

To evaluate code line-by-line

d)

To output text or values to the Console/Terminal

3.

What is the tradition when learning a new programming language?

a)

To write a program that says 'Hello World'

b)

To create a Repl Environment

c)

To use the Debugger for troubleshooting

d)

To learn Python syntax

4.

What happens if there are syntax errors in your code?

a)

The code will not run

b)

The code will run but produce incorrect output

c)

The code will run but produce error messages

d)

The code will run without any issues

5.

Which of the following lines of code are correct?

a)

Print('Hello world!')

b)

print('Hello world!')

c)

print(Hello world!)

d)

print 'Hello world!'

6.

What is the purpose of indentation in Python?

a)

To improve code readability

b)

To indicate a block of code

c)

To prevent syntax errors

d)

To execute Python syntax

7.

How are variables created in Python?

a)

By declaring them using a specific command

b)

By assigning a value to them

c)

By importing them from external libraries

d)

By defining them in a function

8.

What is the purpose of comments in Python code?

a)

To explain the code

b)

To make the code more readable

c)

To prevent execution when testing code

d)

All of the above

9.

How can multi-line comments be added in Python?

a)

By using the # symbol for each line

b)

By using triple quotes (""")

c)

By using the // symbol at the beginning of each line

d)

By using the /* */ symbols

10.

What part of the code indicates a block of code in Python?

a)

Blank lines between statements.

b)

Parentheses surrounding the code block.

c)

Indentation.

d)

Double quotes enclosing the code block.