WorksheetsPython Intro & Types Quiz
Total questions: 40
Worksheet time: 20mins
What is Python mainly used for?
Web development
Data analysis
Making games
All of the above
What symbol is used to start a comment in Python?
//
#
/*
What is a variable in Python?
A type of loop
A container for values
A function
A module
What type of value is 4.5?
Integer
Float
String
Boolean
Which of these is a correct variable name?
my var
1st_name
userName
@value
What does the print() function do?
Add two numbers
Display output
Create variables
Stop the program
Which value is a string?
'Hello'
7
4.2
True
Which operator is used for exponentiation?
*
^
**
%
What does 'int' represent?
A decimal number
A whole number
A text value
A boolean value
What will '5' + '2' return?
7
52
Error
10
What type is the value True?
String
Integer
Float
Boolean
What is the keyword to define a variable?
var
define
let
None of these
Which function gives the length of a string?
size()
length()
len()
count()
What does 10 // 3 return?
3
3.3
3.33
1
What does 10 % 3 return?
0
1
2
3
What type is 'True'?
Boolean
Integer
String
Float
What is the output of print(3 * 'Hi')?
3Hi
HiHiHi
Error
Hi*3
What type is the result of 7 / 2?
Integer
Float
String
Boolean
Which of the following is NOT a data type in Python?
int
str
num
bool
What value does bool(0) return?
True
False
0
Error
Which one of these is not used for math operations?
+
-
@
*
What is the result of 3 + 4 * 2?
14
11
10
9
What is the type of '123'?
int
str
float
bool
Which keyword is used to check data type?
typeof
type()
datacheck
checktype
What is the result of int('4')?
'4'
4
Error
4.0
What is 3.0 * 2?
5
6
6.0
3
Which of these is a Boolean operator?
and
plus
times
divide
What does 5 > 2 return?
True
False
3
Error
What is the output of print(type(3.5))?
int
float
str
bool
What does input() do?
Prints text
Takes user input
Exits the program
Finds length
What is the output of len('Hi')?
1
2
3
Error
What is the output of type(True)?
bool
Boolean
Bool
boolean
What is the result of 4 + int('3')?
7
43
Error
4
Which is NOT a built-in data type?
int
str
long
float
What does 3 * 2 + 1 equal?
7
9
8
6
What will print('Hello' + 'World') show?
HelloWorld
Hello World
Hello+World
Error
What does bool('') return?
True
False
Error
None
Which function converts to string?
str()
to_string()
string()
convert()
What is the result of 'a' * 4?
aaaa
Error
4a
a a a a
What will print(7 % 2) display?
3
2
1
0
