WorksheetsScientific Computing with Python-Basics
Total questions: 10
Worksheet time: 5mins
Name
Class
Date
1.
Which character is used for commenting in Python?
a)
#
b)
!
c)
@
d)
*
2.
Which is not a reserved word keyword in Python?
a)
insert
b)
pass
c)
class
d)
lambda
3.
Which of the following is the floor division operator?
a)
/
b)
%
c)
//
d)
\\
4.
Which of the following will be printed?
x=4.5
y=2
print (x//y)
a)
2.0
b)
2.25
c)
.25
d)
0.5
5.
In Python, keywords are case sensitive.
a)
True
b)
False
6.
What will be the output of the given code?
>>>"h"+"lm"
a)
h
b)
"hlm"
c)
lm
d)
hlm
7.
Which file contains the predefined Python codes?
a)
Function
b)
Pi
c)
module
d)
lambda
8.
What is the use of the return statement?
a)
exit a function
b)
null value
c)
initiate a function
d)
none
9.
Which keyword is used to create an anonymous function?
a)
def
b)
lambda
c)
assert
d)
pi
10.
What will be the output of the given code?
>>>string="Hello MEC!"
>>>len(string)
a)
9
b)
10
c)
8
d)
12
100 %
