wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Basics Class 6

Total questions: 43

Worksheet time: 21mins

Name
Class
Date
1.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
2.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
3.
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
4.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
5.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
6.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
7.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
8.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
9.
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
10.

Which is the Python logo?

a)
b)
c)
d)
11.

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

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.

Operators used in python:


divide, multiply, add, subtract

a)

/, *, +, -

b)

div, mul, +, -

c)

\, x, +, -

d)

~, *, +, -

15.
How would would you print a text string?
a)
output "Hello!"
b)
print ("Hello!")
c)
print (Hello!)
d)
output (Hello!)
16.

What is the answer to this expression, 22%3 is

a)

7

b)

1

c)

0

d)

5

17.

Which is the correct operator for power  xyx^y  

a)

x^y

b)

x**y

c)

x^^y

d)

None of these

18.

Which one of theses is floor division

a)

/

b)

//

c)

%

d)

None of theses

19.

What is the order of precedence in Python?

i. Parenthesis

ii. Exponential

iii. Multiplication

iv. Division

v. Addition

vi. Subtraction

a)

i, ii, iii, iv, v, vi

b)

ii, i, iii, iv, v, vi

c)

ii, i, iv, iii, v, vi

d)

i, ii, iii, vi, v, iv

20.

Mathematical operations can be performed on a string

a)

True

b)

False

21.

Operators with same precedence are evaluated in which manner?

a)

Left to Right

b)

Right to Left

c)

Can't Say

d)

None of the mentioned

22.

What is the output of this expression, 3*1**3

a)

27

b)

9

c)

3

d)

1

23.

Which of the following is true for variable names in python?

a)

Unlimited Length

b)

all private members must have leading and trailing underscores

c)

underscores and ampersand are only two special characters allowed

d)

None of these

24.

Which of the following is an invalid variable?

a)

my_string_1

b)

1st_string

c)

foo

d)

-

25.

is Python case sensitive when dealing with identifiers?

a)

yes

b)

no

c)

machine dependent

d)

none of these

26.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
27.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
28.
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
29.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
30.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
31.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
32.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
33.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
34.
Which of these would work as a piece of code?
a)
IF answer == "Yes":
b)
if answer == "Yes"
c)
if answer == "Yes":
d)
if answer = "yes":
35.
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
36.
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
37.

Which is the Python logo?

a)
b)
c)
d)
38.

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

39.

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

40.

What function is used to output a message in python?

a)

print("")

b)

input=name

c)

print

d)

name=input

41.

What syntax would you use to create a name variable?

a)

name=input()

b)

input=name

c)

name=input{}

d)

name=INPUT

42.

What is pseudocode?

a)

A planning tool that resembles code but is not code used for humans.

b)

Syntax code

c)

A programming language.

d)

A pastry.

43.

Why would you use a loop?

a)

To repeat a piece of code

b)

To create a loop

c)

To input data