wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Week 4 - What is Python?

Total questions: 46

Worksheet time: 23mins

Name
Class
Date
1.

Who developed Python Programming Language?

a)

a) Wick van Rossum

b)

b) Rasmus Lerdorf

c)

c) Guido van Rossum

d)

d) Niene Stom

2.

Which of the following is the correct extension of the Python file?

a)

a) .python

b)

b) .pl

c)

c) .py

d)

d) .p

3.

Which of the following character is used to give single-line comments in Python?

a)

/*

b)

b) #

c)

c) !

d)

d) /*

4.

Which of the following functions is a built-in function in python?

a)

a) factorial()

b)

b) print()

c)

c) seed()

d)

d) sqrt()

5.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
6.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
7.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
8.

Which statement prints I am 10 years old?

a)

pint("I am 10 years old.")

b)

print('I am 10 years old.)

c)

print('')I am 10 years old.

d)

print("I am 10 years old.")

9.

Which statement prints 7 (Select 2 answers)

a)

print 7

b)

print("7"

c)

print("7")

d)

print(3 + 4)

10.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

11.

Which is the Python logo?

a)
b)
c)
d)
12.

What function is used to output a message in python?

a)

print("")

b)

input=name

c)

print

d)

name=input

13.

x = 5

y = 6

print(x*y)


The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

14.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
15.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
16.

What is a output?

a)

A piece of data that is shown on the screen.

b)

Data that the user enters

c)

An output

d)

A orange

17.

What will the output be from the following Python code?

Print("Hello world!")

a)

NameError

b)

Hello world!

c)

"Hello world"

d)

Print(Hello world!)

18.

A function is a mini program that runs and returns a value to your program.

a)

True

b)

False

19.

You need to use a (a)   symbol in a string.

20.

To create a comment in Python you use?

a)

@

b)

#

c)

%

d)

$

21.

Integers are...

a)

Decimals

b)

Whole Numbers

c)

Floats

d)

Extra Decimals

22.

Floats are...

a)

Decimals

b)

Whole Numbers

c)

Integers

d)

Extra Decimals

23.

To perform addition in Python we use the

a)

+

b)

-

c)

/

d)

*

24.

To perform division in Python we use the

a)

+

b)

-

c)

/

d)

*

25.

To perform multiplication in Python we use the

a)

+

b)

-

c)

/

d)

*

26.

To perform subtraction in Python we use the

a)

+

b)

-

c)

/

d)

*

27.

To use exponents in Python we use the

a)

+

b)

-

c)

**

d)

*

28.

Errors in the rules of the language are known as?

a)

Syntax

b)

Run TIme

c)

Logic

29.

The hardest type of error to detect is a?

a)

Syntax

b)

Run TIme

c)

Logic Error

30.

An error that cause a program to crash is a..

a)

Syntax

b)

Run Time

c)

Logic Error

31.

The escape sequence for a double quote is?

a)

\"

b)

/"

c)

\\"

d)

//"

32.

The escape sequence for a single quote is?

a)

\'

b)

/'

c)

\\'

d)

//'

33.

The escape sequence for a backslash character is?

a)

\

b)

/

c)

\\

d)

//

34.

This is a placeholder for a value.

a)

String

b)

Variable

c)

Integer

d)

Method

35.

.upper(), .lower(), .title() are all types of

a)

Variables

b)

Integers

c)

Floats

d)

Methods

36.

.upper( ) makes all your text?

a)

Snake Case

b)

Lower Case

c)

Capitalized

d)

Initial Caps

37.

.lower( ) makes all your text?

a)

Snake Case

b)

Lower Case

c)

Capitalized

d)

Initial Caps

38.

.title( ) makes all your text?

a)

Snake Case

b)

Lower Case

c)

Capitalized

d)

Initial Caps

39.

Strings can be added together using what process?

a)

Float

b)

Concatenation

c)

Integers

d)

Variable

40.

The print( ) function can be used with a combination of text and variables?

a)

True

b)

False

41.

The f, in f-strings, stands for?

a)

Fun

b)

Format

c)

Function

d)

Form

42.

f-strings allow you to do...

a)

Place strings into a variable and format it as a variable.

b)

Nothing

c)

Place variables into a string and format it as text.

d)

Place strings into a variable and format it as text.

43.

A series of characters (letters, numbers, and spaces). Always enclosed in quotes.

a)

print( )

b)

String

c)

Variable

d)

Runtime Error

44.

Which of the following is correct?

a)

Print(4-4)

b)

print("4-4")

c)

print(4-4)

d)

Print("4-4")

45.

When you use a variable before it is declared you will get a?

a)

TypeError

b)

SyntaxError

c)

NameError

d)

Syntax Error

46.

Characters that allows Python to use reserved symbol in strings

a)

NameError

b)

SyntaxError

c)

TypeError

d)

Escape Characters