Which of the following is invalid?
What dataype is the object below ?
L = [1, 23, ‘hello’, 1].
What is the output of the following?
string = "my name is x"
for i in string:
print (i, end=", ")
What is the output of this expression, 3*1**3?
What are the values of the following expressions:
2**(3**2)
(2**3)**2
2**3**2
What is the output of the code shown below?
'The {} side {1} {2}'.format('bright', 'of', 'life')
Which of these in not a core datatype?
Operators with the same precedence are evaluated in which manner?
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
Why are local variable names beginning with an underscore discouraged?
What is the value of the following expression:
24//6%3, 24//4//2
Suppose i is 5 and j is 4, i + j is same as
What is the output of the code show below if a=10 and b =20?
a=10
b=20
a=a^b
b=a^b
a=a^b
print(a,b)
What is the output of the code shown below?
def f(x):
def f1(*args, **kwargs):
print("*", 5)
x(*args, **kwargs)
print("*", 5)
return f1
@f
def p(m):
p(m)
print("hello")
Which of the following is incorrect?
What is the result of the expression if x=15 and y=12:
x & y
What is the output of the following code ?
>>>example = "snow world"
>>>print("%s" % example[4:7])
What is the output of the following?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
-
-
-
-
What is the output of the following?
a = [0, 1, 2, 3]
for a[0] in a:
print(a[0])
What is the output of the code shown below?
l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)
What is the return type of function id ?
Which of the following is an invalid variable?
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'
Which of the following expressions results in an error?
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
i[x].upper()
print (x)
What is the output of the following?
for i in range(int(2.0)):
print(i)
What is “Hello”.replace(“l”, “e”)
What will be displayed by print(ord(‘b’) – ord(‘a’)) ?
What is the output of the following?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2
Which of the following expressions is an example of type conversion?
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)
Which of the following will run without errors ?
The expression shown below results in an error. State whether this statement is true or false.
print("-%5d0",989)
It is not possible for the two’s complement value to be equal to the original value in any case. State whether this statement is true or false.
What is the output of the following code ?
>>>example = "snow world"
>>>example[3] = 's'
>>>print example
The result of the expression shown below is:
4^12
Given a string example=”hello” what is the output of example.count(l)
What is the value of x if:
x>>2=2
What is the value of this expression:
bin(10-2)+bin(12^4)
What is the maximum possible length of an identifier?