No student devices needed. Know more
25 questions
Is Python a Case Sensitive Language?
Yes
No
May not be
None of the above
Which of the following is a invalid variable in Python
_a=1
__a=1
_str_=1
None of the above
What is answer of this expression, 22 % 3 is?
7
1
0
5
Mathematical operations can be performed on a string.
True
False
May not be
None of the above
What is the output of the following?
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
[‘ab’, ‘cd’].
[‘AB’, ‘CD’].
None of the above
[None, None]
What is the output of the following?
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2
1
1 2
1 2 3 4 5 6...
1 3 5 7 9 11....
What is the output of the following?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
0 1 2 0
0 1 2
error
none of the mentioned
What is the output of the following?
x = 'abcd'
for i in range(x):
print(i)
a b c d
1 2 3 4
error
None of the above
What is the output of the following?
for i in range(10):
if i == 5:
break
else:
print(i)
else:
print("Here")
0 1 2 3 4 Here
0 1 2 3 4 5 Here
0 1 2 3 4
1 2 3 4 5
What is the output when following statement is executed ?>>>"a"+"bc"
a
bc
ac
abc
What is the output when following statement is executed ?>>>"abcd"[2:]
a
ab
ac
cd
What is the output when following code is executed ?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
olleh
hello
h
o
What is the output of the following code ?
>>>example = "snow world"
>>>example[3] = 's'
>>>print example
snow
snow world
error
snos world
Which of the following commands will create a list?
a) list1 = list()
b) list1 = [].
c) list1 = list([1, 2, 3])
d) all of the mentioned
list1 = list()
list1 = [].
list1 = list([1, 2, 3])
all of the mentioned
Suppose list1 is [3, 5, 25, 1, 3], what is min(list1) ?
3
5
1
25
Suppose list1 is [1, 5, 9], what is sum(list1) ?
1
9
15
none
What will be the output?
names1 = ['Amir', 'Bala', 'Chales']
if 'amir' in names1:
print(1)
else: print(2)
None
1
2
error
Which of the following is a Python tuple?
[1, 2, 3].
(1, 2, 3)
{1, 2, 3}
{}
What will be the output?>>>t=(1,2,4,3)
>>>t[1:3]
(1,2)
(1,2,4)
(2,4)
(2,4,3)
What is the output of the following code?
nums = set([1,1,2,3,3,3,4,4])
print(len(nums))
7
error
4
8
1. Which of the following statements create a dictionary?
d = {}
d = {“john”:40, “peter”:45}
d = {40:”john”, 45:”peter”}
All of the mentioned
Read the code shown below carefully and pick out the keys?
d = {"john":40, "peter":45}
“john”, 40, 45, and “peter”
“john” and “peter”
40 and 45
None
What is the output of the expression:round(4.576)
4.5
4
5
4.576
Which of the following functions is a built-in function in python?
seed()
sqrt()
factorial()
print()
_____ represents an entity in the real world with its identity and behaviour
a method
a object
a class
a operator
Explore all questions with a free account