Assignment:
1-Which of these is not a core data type?
(A) Lists
(B) Dictionary
(C) Tuples
(D) Class -
2-What data type is the object below ?
L = [1, 23, ‘hello’, 1]
(A) List -
(B) Dictionary
(C) Tuple
(D) Array
3-What is the output of the expression : 3*1**3
(A) 27
(B) 9
(C) 3 -
(D) 1
4-Which of the following function convert a string to a float in python?
(A) int(x [,base])
(B) long(x [,base] )
(C) float(x) -
(D) str(x)
5- What is the output of the following code?
i = 0
while i < 3:
print i
i += 1
else:
print 0
6-What is the output of the following code?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
7-What is the output of the following code?
def f(value, values):
v = 1
values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])
8-What is the output of the following code?
eval(''1 + 3 * 2'')
9-What is output of
33 == 33.0
10-Which of the following is an invalid variable?
a) my_string_1
b) 1st_string
c) foo
d) _
1-Which of these is not a core data type?
(A) Lists
(B) Dictionary
(C) Tuples
(D) Class -
2-What data type is the object below ?
L = [1, 23, ‘hello’, 1]
(A) List -
(B) Dictionary
(C) Tuple
(D) Array
3-What is the output of the expression : 3*1**3
(A) 27
(B) 9
(C) 3 -
(D) 1
4-Which of the following function convert a string to a float in python?
(A) int(x [,base])
(B) long(x [,base] )
(C) float(x) -
(D) str(x)
5- What is the output of the following code?
i = 0
while i < 3:
print i
i += 1
else:
print 0
6-What is the output of the following code?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
7-What is the output of the following code?
def f(value, values):
v = 1
values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])
8-What is the output of the following code?
eval(''1 + 3 * 2'')
9-What is output of
33 == 33.0
10-Which of the following is an invalid variable?
a) my_string_1
b) 1st_string
c) foo
d) _
Comments
Post a Comment