wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz: Hello World

Total questions: 8

Worksheet time: 8mins

Name
Class
Date
1.

What is the main purpose of programming languages?

a)

To build houses

b)

To play music

c)

To instruct computers

d)

To cook food

2.

What is the main goal of the class?

a)

To learn how to speak and write

b)

To learn how to program and think logically

c)

To learn how to draw

d)

To learn how to cook

3.

Which is a correct way to write "Hello World" in Python?

a)

print('Hello World')

b)

print("Hello World")

c)

print(Hello, World)

d)

print("Hello, World")

4.

What does end=" " do in the print() function?

a)

Adds the word inside the " " at the end of the line

b)

Adds a space at the end

c)

Adds a comma at the end

d)

Adds a period at the end

5.

What is the purpose of using end="" in the print() function?

a)

To add a period at the end

b)

To add a space at the end

c)

To add a comma at the end

d)

To keep it from skipping a line or add a word at the end

6.

What will the output be for the code:

print("Cat", end=" ")

print("Dog")

a)

Cat Dog

b)

CatDog

c)

Cat Dog

d)

Catdog

7.

What will the output be for the code:

print("Sun", end="")

print("Shine")

a)

Sun: Shine

b)

Sun Shine

c)

SunShine

d)

Sun, Shine

8.

What will the following code print if the 'end' parameter is set to a single quote?

print("It's")

print("Fine")

a)

It's
Fine

b)

It's Fine

c)

It'sFine

d)

It's' Fine