Logo

Python Questions Set 132:

Quiz Mode

 The result of the expression shown below is: 

 

4^12

1
2
3
4

Solution:

 Guess the output?



import datetime
d=datetime.date(2017,06,18)
print(d)

1
2
3
4

Solution:

 

What will be the output of the following Python statement?


>>> print('x\97\x98')

1
2
3
4

Solution:

What is the output of the following code?


x = "1234"

y = 1234

print(x)

print(y)

1
2
3

Solution:

 

What will be the output of the following Python code?

  1. >>>list1 = [11, 2, 23]
  2. >>>list2 = [11, 2, 2]
  3. >>>list1 < list2 is

1
2
3
4

Solution:

What is the output of the following code?


str = "welcome to Abekus"

print(str.title())

1
2
3
4

Solution:

fp=open("txt.txt")

x=fp.read()

print(len(x))




if the file txt.txt contains the following text, then what is the output of the above code?


Hello

World!! hi

Hello


Solution:

 

What will be the output of the following Python code?


 import random

 random.choice([10.4, 56.99, 76]) 

1
2
3
4

Solution:

 

What is the output of the following piece of code?

a=list((45,)*4)
print((45)*4)
print(a)

1
2
3
4

Solution:

Find the output of the following code:

def a(a, b): if type(a) != type(b): return "Enter valid data type" e = a + b d = e * 10 return d c = a(15, 16) print(c) k = a(15, 'abekus') print(k)

1
2
3
4

Solution: