Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

BSIT 2 - Python Basics

Total questions: 25

Worksheet time: 12mins

Name
Class
Date
1.

To display something on the screen, use this command:

a)

print()

b)

Print()

c)

screen()

d)

write()

e)

display()

2.

To display the following on screen

Hello World!

the following command should be used:

a)

print(Hello World!)

b)

print("Hello World!")

c)

print("Hello World" + !)

d)

print"(Hello World!)"

3.

x = 5

y = 6

print(x*y)


The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

4.

x = 5

y = 6

print("x*y")


The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

5.

x = 5

y = 6

print(x*y)


Select the correct answer(s):

a)

x is a variable

b)

x is a value

c)

print() is a funciton

6.

age = input("Enter Age (as integer): ")

newAge = age + 20

print ("your age in 20 years is:", newAge)


you enter

15

a)

value of age is 15

value of newAge is 35

output is: your age in 20 years is: 35

b)

value of age is 15

value of newAge is 20

output is: your age in 20 years is: 20

c)

value of age is 15

value of newAge is "age + 20"

output is: your age in 20 years is: 35

d)

value of age is 15

value of newAge is 35

output is: your age in 20 years is:35

7.

Operators used in python:


divide, multiply, add, subtract

a)

/, *, +, -

b)

div, mul, +, -

c)

\, x, +, -

d)

~, *, +, -

8.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
9.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
10.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
11.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
12.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
13.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
14.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
15.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
16.

Which is the Python logo?

a)
b)
c)
d)
17.

What is a input?

a)

A function that allows us to ask the user to enter some data.

b)

To plug in something.

c)

Data displayed on a screen.

d)

A function

18.

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

19.

What function is used to output a message in python?

a)

print("")

b)

input=name

c)

print

d)

name=input

20.

What syntax would you use to create a name variable?

a)

name=input()

b)

input=name

c)

name=input{}

d)

name=INPUT

21.
How would you assign an integer to a variable?
a)
new_var = 4
b)
new_var == 4
c)
new_var = "4"
d)
new var "4"
22.
How would would you print a text string?
a)
output "Hello!"
b)
print ("Hello!")
c)
print (Hello!)
d)
output (Hello!)
23.
To create a variable named new_var and assign it a value of 81 divided by 9, which statement would you use?
a)
new_var = 81 \ 9
b)
new_var = "81 / 9"
c)
new_var = "81 \ 9"
d)
new_var = 81 / 9
24.
Which of the following is not a string?
a)
new_var = "True"
b)
new_var = "3123"
c)
new_var = "3.123"
d)
new_var = False
25.

A _____________ expression is an expression that is either true or false.

a)

boolean

b)

truth

c)

variable

d)

conditional