What will be the output of the following Python code?
print("ccdcddcd".find("c"))
Which of the following is not a valid string method in Python?
What will be the output of the following Python code snippet?
for x in set('pqr'):
print(x*2)
What will be the output of the following Python code?
names1 = ['Amir', 'Bala', 'Chales']
if 'amir' in names1:
print(1)
else:
print(2)
Which of the following Boolean expressions is not logically equivalent to the other three?
What will be the output of the following Python code, if the sys module has already been imported?
sys.stdout.write("hello world")
def test(i,j):
if(i==0):
return j
else:
return test(i-2,i+j)
print(test(4,7))
What will be the output of the following Python code if the system date is: 6/19/2017
tday=datetime.date.today()
tdelta=datetime.timedelta(days=10)
print(tday+tdelta)
>>> x = 24.22
>>> y = 12.06
>>> z = max (x//2, y)
>>> z
What will be the output of the following Python code?
class Test:
def __init__(self):
self.x = 0
class Derived_Test(Test):
def __init__(self):
self.y = 1
def main():
b = Derived_Test()
print(b.x, b.y)