What is the output of the following?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1
What is the output of the following?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
-
-
-
-
What is the value of the following expression:
24//6%3, 24//4//2
What is the result of the expression:
0x35 | 0x75
What is the output of the code shown?
['f', 't'][bool('spam')]
Which of the following is the truncation division operator?
The output of executing string.ascii_letters can also be achieved by:
What is the output of the following?
string = "my name is x"
for i in ' '.join(string.split()):
print (i, end=", ")
What is the output of the code shown below?
'The {} side {1} {2}'.format('bright', 'of', 'life')
What is the output of the following?
for i in '':
print (i)
Which of the following expressions involves coercion when evaluated in Python?
In order to store values in terms of key and value we use what core datatype.
To return the length of string s what command do we execute ?
Which of the following expressions can be used to multiply a given number ‘a’ by 4?
What is the output of the following code ?
>>>example = "helle"
>>>example.rfind("e")
Which of these in not a core datatype?
Given a function that does not return any value, What value is thrown by default when executed in shell.
What is the output of the code shown?
s='%s, %s & %s'
s%('mumbai', 'kolkata', 'delhi')
The expression 2**2**3 is evaluates as: (2**2)**3. State whether this statement is true or false.
What arithmetic operators cannot be used with strings ?
The output of the line of code shown below is:
not(10<20) and not(10>30)
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?
'{0:.2f}'.format(1.234)
What is answer of this expression, 22 % 3 is?
Why are local variable names beginning with an underscore discouraged?
Which of the following will run without errors ?
What is the value of this expression:
bin(10-2)+bin(12^4)
What is the output of the following?
print('*', "abcdef".center(7), '*')
In python we do not specify types,it is directly interpreted by the compiler, so consider the following operation to be performed.
>>>x = 13 ? 2
objective is to make sure x has a integer value, select all that apply (python 3.xx)
What is the value of the expression:
4+2**5//10
What is the output of the following expression if X=345?
print(“%06d”%X)
What is the output of the code shown?
a='hello'
q=10
vars()
Consider the snippet of code shown below and predict the output.
X=”san-foundry”
print(“%56s”,X)
What is the result of round(0.5) – round(-0.5)?
What is the output of the following?
print("abcdef".center(7, 1))
Which of the following expressions is an example of type conversion?
What are the output of the code shown below?
def f(x):
def f1(*args, **kwargs):
print("*"* 5)
x(*args, **kwargs)
print("*"* 5)
return f1
def a(x):
def f1(*args, **kwargs):
print("%"* 5)
x(*args, **kwargs)
print("%"* 5)
return f1
@f
@a
def p(m):
print(m)
p("hello")
What is the output of this expression if X= -122?
print("-%06d"%x)
Which of the following is incorrect?
What is the result of the expression:
int(1011)?