
Revision and Extended Learning for Lab 1
Authored by Careene McCallum
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What TYPE of value is stored in the variable num?
Integer
Float
String
Boolean
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the value of ans if num is 12?
4.0
4
4.33
TypeError: unsupported operand type(s) for /: 'str' and 'int'
3.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What correction should be made to line 2 to ensure proper execution? NB: There are TWO possible answers.
ans = float(num) /3
ans = num(float) / 3
ans = f"{float(num) / 3}"
ans = f"(float(num) / 3)"
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What value is printed if the user enters 12?
TypeError: unsupported operand type(s) for /: 'str' and 'int'
4.33
4
4.0
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the data type of formatted_num?
str
int
float
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the data type for formatted_num?
str
int
float
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of :d in the f-string?
It ensures that the variable num_items is treated as an integer when formatting the output.
It formats the number as a string.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?