NEW
Font size
WorksheetsUnit I_Quizz
Total questions: 40
Worksheet time: 30mins
Python is a ______ language.
Compiled
Low-level
Interpreted
Assembly
Python supports which programming approaches?
Only procedural
Only object-oriented
Structured and object-oriented
Functional only
In Python, everything is treated as a:
Function
Variable
Object
Module
Which property of an object represents its attributes?
State
Behavior
Identity
Method
Which uniquely identifies an object?
Class
State
Behavior
Identity
Which of the following is NOT a common Python data type?
Sequence
Pointer
Numeric
Dictionary
Variables in Python are instances of:
Modules
Classes
Functions
Files
Which numeric data type stores whole numbers?
complex
int
float
bool
Which symbol separates long integers for readability in Python?
,
_
;
:
Which represents scientific notation?
10^6
1*10^6
1e6
1.6
Output of type(3j) is:
int
complex
float
str
Binary numbers in Python are prefixed with:
0d
0b
0o
0x
What is the base of octal numbers?
2
8
7
16
Hexadecimal numbers use which symbols?
0–7
A–Z
0–9, A–F
0–9
Function to convert integer to binary string is:
int()
hex()
oct()
bin()
0XA2 in decimal equals:
160
162
164
166
A float number is accurate up to:
5 decimal places
10 decimal places
15 decimal places
Unlimited
Output of float() with no arguments is:
None
1.0
Error
0.0
Value of 1.23E3 is:
123
1230
12300
12.3
A complex number consists of:
Only real part
Only imaginary part
Real and imaginary parts
Integer and float
complex(5.3) returns:
(0+5.3j)
(5.3+0j)
(5.3+5.3j)
Error
Strings in Python are:
Mutable
Immutable
Numeric
Callable
Negative indexing -1 refers to:
First character
Second character
Middle character
Last character
Lists in Python are:
Immutable
Mutable
Fixed size
Ordered but immutable
Which list operation is valid?
list[2] = value
list(2)
list + int
list / 2
Tuples are:
Mutable
Immutable
Unordered
Changeable
Tuples are written using:
{}
[]
()
||
Default start value of range() is:
1
-1
0
None
range(1,10,2) produces:
Even numbers
Odd numbers
All numbers
Error
Sets are:
Ordered
Indexed
Unordered
Immutable
Sets do NOT allow:
Integers
Strings
Duplicates
Tuples
Method to add a single element to set:
append()
insert()
push()
add()
Method to add multiple elements to a set:
add()
update()
append()
extend()
Frozenset can be used as:
List index
Dictionary key
Set element
File name
How many types of functions exist in Python?
2
3
5
4
Which is a built-in function?
myFunc()
userFunc()
lambda()
len()
bool(0) returns:
True
False
0
Error
Function used to get the type of an object:
id()
isinstance()
vars()
type()
What is the result of the expression 5 > 3 and 2 < 4?
True
False
1
Error
Which operator is used to find the remainder of a division?
//
%
**
/
