Logo

Python Questions Set 111:

Quiz Mode

What is the output of the following code?


v = 2 * 4 ** 2

print(v)

1
2
3
4
5

Solution:

 

What will be the output of the following Python function?


complex(1+2j)

1
2
3
4

Solution:

 

What is the value of the following expression?

2+4.00, 2**4.0

1
2
3
4

Solution:

Which of the following statements is optional in any Python program?

1
2
3
4

Solution:

If a='cpp', b='buzz' then what is the output of:

c = a-b

print(c)

1
2
3

Solution:

What is the output of the following Python code?

print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))

1
2
3
4

Solution:

What will be the output of the following Python code?

x = "abcdef"
i = "a"
while i in x:
x = x[1:]
print(i, end=" ")

1
2
3
4

Solution:

What is the output of the given code?


tuple=('Abekus','learning')

tuple1=(1,2,3,4,6)

tuple2=(tuple1+tuple)

print(tuple2)

1
2
3
4

Solution:

What will be the output of the following code?

def a(func): def b(): print("**") func() print("##") return b @a def sport(): sco = 10 print(sco * 10)

1
2
3
4

Solution:

Can we create custom exception classes in Python?

1
2
3
4

Solution: