wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

BZA Python Programming 3

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What would this code do?

print('Hello World!')

a)

hello world

b)

Hello World!

c)

hello world!

d)

'Hello World!'

2.

What is the correct way to make python program so it says Pleased to meet you

a)

print('Pleased to meet you.')

b)

print('Pleased to meet you.)

c)

Print('Pleased to meet you.')

d)

print 'Pleased to meet you.'

3.

What does this code do when run the following program: 

name='Aluko' 

print('Hello '+name)

a)

hello aluko

b)

Hello aluko

c)

'Hello Aluko'

d)

Hello Aluko

4.

What is missing to complete this code: 

language='Python' 

print('I am learning to program in'______)

a)

+ language

b)

+ Language

c)

language

d)

Language

5.

What word best complete this code?

print('I am ____ when l try my best')

a)

Rubbish

b)

Amazing

c)

So so

d)

Lucozade

6.

What would this code print?

name='Chan' 

name='Aluko' 

print(name)

a)

Chan

b)

name

c)

Aluko

d)

print Aluko

7.

What would this code print?

name='Chan' 

name='Aluko' 

name='WDF'

print(name)

a)

Aluko

b)

Chan

c)

WDF

d)

name

8.

What would this code print

name='Poppy' 

name='Beka' 

print('Hello '+name)

a)

Poppy

b)

Liz

c)

Hello Poppy

d)

Hello Beka

9.

The symbol + is used to concatenate, what does this do?

a)

Add stuff

b)

Jog stuff

c)

Join things

d)

It's a sign

10.

What is the purpose of the input command?

a)

To make a user/someone to answer a question

b)

To ask or extract something

c)

Important question

d)

Inputting stuff

11.

The program below asks for the town you live in, it is testing the use of?

town = input('Which town do you live in? ')

print('I love visiting ' + town)

a)

Variable town, input + & print result

b)

Where you love visiting

c)

Programming stuff

d)

I don't know yet

12.

A program that asks for your first name, your last name and finally greets you with your full name.

name1 = input('What is your first name? ') James

name2 = input('What is your last name? ') Bond

print('Hello ' + name1 + ' ' + name2)

a)

My Name is Bond James Bond

b)

Mr Bond

c)

Hello James Bond

d)

Hello Bond James

13.

What is the output of this code below?

name = input('What is your name? ') Dr Who

print(name + ' ' + name + ' ' + name + ' ' + name + ' ' + name)

a)

Dr WhoDr WhoDr WhoDr WhoDr Who

b)

Dr Who Dr Who Dr Who Dr Who Dr Who

c)

Dr Dr Dr Dr Dr

d)

Who Who Who Who Who

14.

Python program 3, can carry out calculations. The arithmetic operators we use to do this are: Addition, Subtraction, Multiplication & Division?

a)

Plus, Subtract, Times & Divide

b)

+ - * /

c)

+ - x \

d)

+ - * \

15.

Using Int(Integer) in python means what?

a)

Interger

b)

Internet

c)

Decimal number

d)

Whole number

16.

What is the output of these code?

print(1 + 6)

print(7 - 5)

print(3 * 9)

print(7 / 2)

a)

7

2

27

3.5

b)

7

2

12

3

c)

7

12

6

3.5

d)

7

12

27

3.5

17.

What is the output of these code?

a = 7

b = 8

c = a + b

print(c)

a)

51

b)

15

c)

c

d)

= 7 + 8

18.

A boolean condition is one that can have only two values true or false, yes or no, 0 or 1 like in a binary, on or off like switch - power button? 

a)

TRUE

b)

FALSE

19.

In python, what does != operator mean?

a)

Exclamation mark

b)

Shouting loud

c)

not equal to

d)

Very equal to

20.

​ What is the reset password in this code?

password = input('Please enter the password: ')

while password != "Password1":

print('Incorrect!')

password = input('Please enter the password: ')

print('Accepted')

a)

Enter

b)

password1

c)

Apple1

d)

Password1