Logo

Python Questions Set 192:

Quiz Mode

What is the boolean value of -1?

1
2
3

Solution:

  Where is function defined? 

1
2
3
4

Solution:

 The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid. 

1
2

Solution:

 

What will be the output of the following Python code?

print('xyxxyyzxxy'.lstrip('xyy'))

1
2

Solution:

What will be the output of the following Python code?

a={1:5,2:3,3:4}
print(a.pop(4,9))

1
2
3
4

Solution:

What is difference between range and xrange ?

1
2
3

Solution:

 What does the function re.match do? 

1
2
3
4

Solution:

What will be the output of the following Python code?

 

def outer(text):
  def inner(text):
     print(text)
   inner(text)
outer("WELCOME TO ABEKUS")

1
2
3
4

Solution:

What is the error?

1_case_style = "pothole is the the best case style"

2_case_style = " & anyone who disagrees is stupid"

print 1_case_style + 2_case_style



1
2
3

Solution:

What is the output of the following code?


class A:

    print("class A")

class B(A):

    print("class B")

b = B()

print(isinstance(b, B))

print(isinstance(b, A))

1
2
3
4
5

Solution: