Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python essL2

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

What is a correct syntax to output "Hello World" in Python?

a)

p("hello world)

b)

echo("hello world")

c)

echo "hello world"

d)

print("hello world")

2.

How do you insert COMMENTS in Python code?

a)

// This is comment

b)

#This is comment

c)

/*this is comment /*

d)

""

3.

Which of these collections defines a LIST?


a)

{"apple", "banana", "cherry"}

b)

("apple", "banana", "cherry")

c)

{"name": "apple", "color": "green"}

d)

["apple", "banana", "cherry"]

4.

How do you start writing an if statement in Python?


a)

if (x > y)

b)

if x > y then:

c)

if x > y:

d)

none of the bove

5.

How do you start writing a while loop in Python?


a)

while x > y:

b)

while x > y {

c)

x > y while{

d)

while (x > y)

6.

How do you create a variable with the numeric value 5?

a)

x = int(5)

b)

x = 5

c)

Both the other answers are correct

7.

Which operator is used to multiply numbers?

a)

%

b)

#

c)

*

d)

x

8.

Which operator can be used to compare two values?

a)

><

b)

=

c)

== 

d)

<>