WorksheetsPython Datatypes
Total questions: 13
Worksheet time: 13mins
What are the possible values for a boolean datatype
Yes, No
Ok, Cancel
True, False
0, 1
What are the two sub categories of numeric data type?
int, float
String, text
bool, text
int, str
'int' can contain only
decimals
whole numbers
0 and 1
true or false
Casting is the process of (a)
Match the following
int
whole numbers
bool
true or false
str
text
float
decimal numbers
int
0
Match the outputs
int(3)
3
float(3)
3.0
str(3.0)
'3.0'
int(3.0)
3
float('3.0')
3.0
The input() always converts the user-input to
boolean
int
float
text
0.0 (a)
'0.0' (a)
What's wrong with the following code?
Float("33.71")
(a)
What will be the value of c in the following program if the user inputs 3 for a and 5 for b?
a = input("Enter number 1")
b = input("Enter number 2")
c = a * b
35
3 * 5
15
Program Error
What will be the value of c in the following program if the user inputs 3 for a and 5 for b?
a = input("Enter number 1")
b = input("Enter number 2")
c = a - b
2
-2
Program Error
3-5
What will be the value of c in the following program if the user inputs 3 for a and 5 for b?
a = input("Enter number 1")
b = input("Enter number 2")
c = a + b
8
35
3 + 5
Program Error
