wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming - Output

Total questions: 12

Worksheet time: 7mins

Name
Class
Date
1.

What will the following code print:

print("hellworld")

a)

hellworld

b)

helloworld

c)

you will get a syntax error

d)

Null (nothing)

2.

What will the following code output?

print("james\nbond")

a)

james\nbond

b)

james

bond

c)

jamesbond

d)

syntax error

3.

What will the following code output?

print("hello"world)

a)

syntax error

b)

hello"world

c)

helloworld

d)

hello

4.

"Breaks down a goal or problem into smaller and manageable solutions or tasks".


What programming construct does this describe?

a)

Abstraction

b)

Decomposition

c)

Pattern Recognition

d)

Algorithm

5.

What is an algorithm?

Select the description that defines algorithm the most accurately.

a)

An algorithm is a list of rules to follow in order to solve a problem.

b)

An algorithm is a variable type used in high-level languages.

c)

An algorithm is a low-level programming language.

d)

An algorithm is a type of pattern recognition technique to fix hardware.

6.

Python is a low-level programming language.

a)

True

b)

False

7.

What symbol do we need to use in Python to add comments in our program?

a)

/

b)

\

c)

*

d)

#

e)

@

8.

What will the following code output?

print("error")

a)

error

b)

syntax error

c)

eror

d)

printerror

9.

There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle. How many ducks are there?

a)

One

b)

Two

c)

Three

d)

Four

10.

What will the following code output?

Print("first/nprogram")

a)

first/nprogram

b)

first

program

c)

syntax error

d)

firstprogram

11.

What do we mean by syntax?

a)

A set of rules to follow for programming languages.

b)

A variable type standard.

c)

A string of text we can use in Python.

d)

A function we can use to output text.

12.

Type the code to output the EXACT string of text:


ComputerScience2022

(a)