wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Review

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.
String
a)

positive and negative whole numbers

b)

a sequence of characters or words

c)

true or false values for logical operations

d)

numbers with fractional components/decimals

2.
Integer
a)
positive and negative whole numbers
b)
a sequence of characters or words
c)
true or false values for logical operations
d)
numbers with fractional components/decimals
3.
Float
a)
positive and negative whole numbers
b)
a sequence of characters or words
c)
true or false values for logical operations
d)
numbers with fractional components/decimals
4.
Boolean
a)
positive and negative whole numbers
b)
a sequence of characters or words
c)
true or false values for logical operations
d)
numbers with fractional components/decimals
5.

Which if the values below return FALSE if executed?

a)

10>3

b)

10<3

c)

10><3

d)

10<>3

6.

Which if the values below is a string data type?

a)

"firstValue"

b)

True

c)

1.0

d)

12.4

7.

_____ is a data type that can represent one of two values either True or False such as 2 > 1, 3 < 2.

a)

integer

b)

float

c)

string

d)

boolean

8.

What is a Boolean?

a)

A data type that contains whole numbers. E.g. 3, 45, 124

b)

Numbers with decimal point. E.g. 0.5, 2.45, 56.04

c)

Group of characters between quotation marks. E.g. "Table"

d)

Data type that can only be True or False.

9.

What is an Integer?

a)

A data type that contains whole numbers. E.g. 3, 45, 124

b)

Numbers with decimal point. E.g. 0.5, 2.45, 56.04

c)

Group of characters between quotation marks. E.g. "Table"

d)

Data type that can only be True or False.

10.

.upper( )

a)

returns a string in upper case

b)

returns a string lower case

c)

finds the length of a string

d)

replaces a string with another string

e)

combines two strings using the + operator

11.

.lower( )

a)

returns a string in upper case

b)

returns a string lower case

c)

finds the length of a string

d)

replaces a string with another string

e)

combines two strings using the + operator

12.

.replace( )

a)

returns a string in upper case

b)

returns a string lower case

c)

finds the length of a string

d)

replaces a string with another string

e)

combines two strings using the + operator

13.

string concatenation

a)

returns a string in upper case

b)

returns a string lower case

c)

finds the length of a string

d)

replaces a string with another string

e)

combines two strings using the + operator

14.

x = 7

print(x > 3)

What is the output?

a)

True

b)

False

15.

x = 7

print(x < 3)

What is the output?

a)

True

b)

False

16.

print("sun" == "Sun")

What is the output?

a)

True

b)

False

17.

print("twelve" != 12)

What is the output?

a)

True

b)

False

18.

horrorMovie = False

print(not(horrorMovie))

What is the output?

a)

True

b)

False

19.

What is the String Input Syntax?

a)

input()

b)

int(input())

c)

float(input())

20.

What is the Integer Input Syntax?

a)

input()

b)

int(input())

c)

float(input())

21.

What is the Float Input Syntax?

a)

input()

b)

int(input())

c)

float(input())

22.

print(“What year is it?”)

year = int(input())

What datatype is the variable year?

a)

integer

b)

float

c)

string

23.

print(“Enter a city.”

)city = input()

What datatype is the variable city?

a)

integer

b)

float

c)

string

24.

print(“Enter a price.”)

money = float(input())

What datatype is the variable money?

a)

integer

b)

float

c)

string

25.

print(“Please enter your age.”)

age = int(input())

What datatype is the variable age?

a)

integer

b)

float

c)

string

26.

print(“Enter your first name.”)

firstName = input()

What datatype is the variable firstName?

a)

integer

b)

float

c)

string

27.

print(“How cold is it outside?”)

temp = float(input())

What datatype is the variable temp?

a)

integer

b)

float

c)

string

28.

number = 5

str(number) 

 What is the new value?

a)

integer

b)

float

c)

string

29.

decimal = 6.25

str(decimal)

 What is the new value?

a)

integer

b)

float

c)

string

30.

days = “72”

int(days)

 What is the new value?

a)

integer

b)

float

c)

string

31.

students = “123”

int( students )

 What is the new value?

a)

integer

b)

float

c)

string

32.

MyString = "10010"

int(MyString)

 What is the new value?

a)

integer

b)

float

c)

string

33.

num_string = '12'

int(num_string)

 What is the new value?

a)

integer

b)

float

c)

string

34.

num_integer = 23

str( num_integer  )

 What is the new value?

a)

integer

b)

float

c)

string

35.

num_string = "23.45"

float(num_string)

 What is the new value?

a)

integer

b)

float

c)

string

36.

num_str = "578993.4345"

float(num_str)

 What is the new value?

a)

integer

b)

float

c)

string

37.

num = "116386.23456"

float(num)

 What is the new value?

a)

integer

b)

float

c)

string

38.

function to read data

a)

input()

b)

print()

c)

read()

d)

output()

39.

function to show information on the output

a)

input()

b)

print()

c)

read()

d)

output()

40.

function to convert a data in float

a)

int()

b)

print()

c)

input()

d)

str()

e)

float()