NEW
Font size
WorksheetsPython Intro Var and Data Types
Total questions: 20
Worksheet time: 10mins
1. What are variables?
containers for storing data
things that can never change
a piece of characters
3. The data type for strings is denoted as _______
int()
str()
float()
4. The data type for whole numbers is denoted as _______
int()
str()
float()
5. Whole numbers are also known as __________.
integers
strings
float
6. The data type for fractional numbers or decimals is denoted as ______________.
int()
str()
float()
7. Which is the correct command for assigning values to a variable?
variable = "your name"
variable * 22
variable is equal to "this"
8. Which of the following is a variable with a float data type?
variable = 22.47
variable = float_type
variable = 12
9. How do you perform an addition in python?
2 plus 2
2 * 2
2 + 2
10. Which of these divisions will print only the remainder in python?
8 % 3
8 / 3
8 divided by 3
It displays an output
What is the output from the following code?
print ("hello world")
Hello
hello world
print hello world
world
What are the 3 things variables have?
Name
Type
Value
Bus
Car
Cycle
Air
Water
Gas
Maths
English
Science
Name = "John"
Age = 23
What type of data is stored in the variable name?
String
Number
Boolean
Boat
What is the Name of the programming language we are learning?
C++
Python
Cheetah
What type of variable is 5
String
Boolean
Integer
Float
What type of variable is "peanut butter"?
String
Boolean
Integer
Float
What type of variable is -7?
String
Boolean
Integer
Float
What type of variable is 8.9?
String
Boolean
Integer
Float
What type of variable is false?
String
Boolean
Integer
Float
How do you declare a variable in Python?
value : variable_name
variable_name = value
value = variable_name
variable_name : value
