NEW
Font size
WorksheetsPython Review
Total questions: 40
Worksheet time: 20mins
positive and negative whole numbers
a sequence of characters or words
true or false values for logical operations
numbers with fractional components/decimals
Which if the values below return FALSE if executed?
10>3
10<3
10><3
10<>3
Which if the values below is a string data type?
"firstValue"
True
1.0
12.4
_____ is a data type that can represent one of two values either True or False such as 2 > 1, 3 < 2.
integer
float
string
boolean
What is a Boolean?
A data type that contains whole numbers. E.g. 3, 45, 124
Numbers with decimal point. E.g. 0.5, 2.45, 56.04
Group of characters between quotation marks. E.g. "Table"
Data type that can only be True or False.
What is an Integer?
A data type that contains whole numbers. E.g. 3, 45, 124
Numbers with decimal point. E.g. 0.5, 2.45, 56.04
Group of characters between quotation marks. E.g. "Table"
Data type that can only be True or False.
.upper( )
returns a string in upper case
returns a string lower case
finds the length of a string
replaces a string with another string
combines two strings using the + operator
.lower( )
returns a string in upper case
returns a string lower case
finds the length of a string
replaces a string with another string
combines two strings using the + operator
.replace( )
returns a string in upper case
returns a string lower case
finds the length of a string
replaces a string with another string
combines two strings using the + operator
string concatenation
returns a string in upper case
returns a string lower case
finds the length of a string
replaces a string with another string
combines two strings using the + operator
x = 7
print(x > 3)
What is the output?
True
False
x = 7
print(x < 3)
What is the output?
True
False
print("sun" == "Sun")
What is the output?
True
False
print("twelve" != 12)
What is the output?
True
False
horrorMovie = False
print(not(horrorMovie))
What is the output?
True
False
What is the String Input Syntax?
input()
int(input())
float(input())
What is the Integer Input Syntax?
input()
int(input())
float(input())
What is the Float Input Syntax?
input()
int(input())
float(input())
print(“What year is it?”)
year = int(input())
What datatype is the variable year?
integer
float
string
print(“Enter a city.”
)city = input()
What datatype is the variable city?
integer
float
string
print(“Enter a price.”)
money = float(input())
What datatype is the variable money?
integer
float
string
print(“Please enter your age.”)
age = int(input())
What datatype is the variable age?
integer
float
string
print(“Enter your first name.”)
firstName = input()
What datatype is the variable firstName?
integer
float
string
print(“How cold is it outside?”)
temp = float(input())
What datatype is the variable temp?
integer
float
string
number = 5
str(number)
What is the new value?
integer
float
string
decimal = 6.25
str(decimal)
What is the new value?
integer
float
string
days = “72”
int(days)
What is the new value?
integer
float
string
students = “123”
int( students )
What is the new value?
integer
float
string
MyString = "10010"
int(MyString)
What is the new value?
integer
float
string
num_string = '12'
int(num_string)
What is the new value?
integer
float
string
num_integer = 23
str( num_integer )
What is the new value?
integer
float
string
num_string = "23.45"
float(num_string)
What is the new value?
integer
float
string
num_str = "578993.4345"
float(num_str)
What is the new value?
integer
float
string
num = "116386.23456"
float(num)
What is the new value?
integer
float
string
function to read data
input()
print()
read()
output()
function to show information on the output
input()
print()
read()
output()
function to convert a data in float
int()
print()
input()
str()
float()
