NEW
Font size
WorksheetsL1 Console, Variables and Creating a Program
Total questions: 10
Worksheet time: 5mins
What is the command used to display text in the Python console?
display
show
write
What is the purpose of variables in programming?
To store temporary data
To perform arithmetic operations
To display text in the console
To create programs
Which data type is used to store whole numbers in Python?
String
Integer
Float
List
What is the result of the expression '10 + 20'?
30
1020
Error
None of the above
Which function is used to convert a number to a string in Python?
int
str
float
list
What is the correct way to add a string and a number in Python?
string + number
number + string
str(number)
int(string)
What is the purpose of the 'print' function in Python?
To perform arithmetic operations
To convert data types
To display text in the console
To create programs
What is the correct way to calculate the remainder of dividing two numbers in Python?
number1 % number2
number1 / number2
number1 * number2
number1 - number2
What is the purpose of the 'int' function in Python?
To convert a number to a string
To convert a string to a number
To perform integer division
To calculate the remainder
What is the purpose of the 'float' function in Python?
To convert a number to a string
To convert a string to a number
To perform integer division
To calculate the remainder
