wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Fundamentals - II

Total questions: 27

Worksheet time: 9mins

Name
Class
Date
1.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
2.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
3.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
4.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
5.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
6.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
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.

Who invented python programming?

a)

Guido Van Rossam

b)

Dennis Ritchie

c)

Bjarne stroustrup

d)

James Gosling

9.

Is python is an object Oriented language?

a)

Yes

b)

No

10.

Python is a interpreter?

a)

True

b)

False

11.

What does the '#' allow you to do?

a)

Repeat code

b)

Comment on code

c)

Print code

d)

End code

12.

Variables cannot have...

a)

Spaces

b)

Special letters

c)

Both 1 and 2

d)

None of them

13.

Which one is not allowed in declaring variables...

a)

Number

b)

Number One

c)

Number_One

d)

NumberOne

14.

When we input date using input() statement, by default its data type will be...

a)

Decimal

b)

String

c)

contsant

d)

None of them

15.
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
16.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
17.
How do you display text?
a)
input
b)
output
c)
print
d)
variable 
18.
What is the meaning of the following comparison operator?
a >= b
a)
Equal to
b)
Not equal to
c)
Greater than or equal to
d)
Less than or equal to
19.
What is the meaning of the following comparison operator?
a != b
a)
Equal to
b)
Greater than
c)
Not equal to
d)
Less than or equal to
20.
What is syntax?
a)
Syntax is the word used to describe a variable
b)
Syntax is the rules of the programming language
c)
This is used to read information
d)
It is used to output information 
21.
The following code is used to create a variable and store a value. Why will it NOT work?
my number = 36
a)
The variable can't store a number
b)
A variable name cannot have any spaces
c)
There variable name can't be called my number
d)
The equals symbol should be at the beginning of the line
22.
Returns the remainder from division
a)
modulus
b)
exponents
c)
boolean
d)
variables
23.
Surrounds multi-line comments
a)
"""
b)
**
c)
#
d)
%
24.
A line of text that Python won't try to run as code
a)
comment
b)
modulus
c)
variable
d)
boolean
25.
Symbol used for modulus
a)
%
b)
&
c)
#
d)
**
26.
Used to make comments
a)
#
b)
%
c)
**
d)
()
27.
10= 100
Which of the following is used in Python to calculate ten squared?
a)
10 ** 2
b)
10 * 2
c)
10 % 2
d)
10 ** 10