NEW
Font size
WorksheetsPython
Total questions: 15
Worksheet time: 8mins
Which of the following functions can help us to find the version of python that we are currently working on?
sys.version(1)
sys.version(0)
sys.version()
sys.version
What is the order of precedence in python?
Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
What will be the output of the following Python code snippet if x=1?
x<<2
4
2
1
8
What will be the output of the following Python function?
len(["hello",2, 4, 6])
Error
6
4
3
What arithmetic operators cannot be used with strings in Python?
*
+
-
All of the mentioned
To add a new element to a list we use which Python command?
list1.addEnd(5)
list1.addLast(5)
list1.append(5)
list1.add(5)
What will be the output of the following Python expression?
round(4.576)
4
4.6
5
4.5
What will be the output of the following code snippet?
example = ["Sunday", "Monday", "Tuesday", "Wednesday"];
print(example[-3:-1])
['Monday', 'Tuesday',
Wednesday]
['Monday', 'Tuesday']
['Tuesday', 'Wednesday']
['Wednesday', 'Monday']
An exception is _______.
a module
a special function
a special module
None of the above
What does ~~~~4 evaluates to ?
-4
+4
-5
+5
Which statement is correct?
List is mutable and tuple is immutable
List is immutable and tuple is mutable
Both are immutable
Both are mutable
Which one of the following is not a python's predefined datatype?
List
Dictionary
Tuple
Class
Which one of these is floor division?
/
%
//
$
In python programming, pass is a null statement.
True
False
Which of the following is a python tuple?
[1,2,3]
[]
([1,2],[2,3])
None of the above
