>>> x = y = z = 2
>>> x, y, x
What will be the output of the following Python code?
print('''
\tfoo'''.lstrip())
Predict the output of the following code:
print("Yes\"Yes\hello\"")
What will be the output of the given code?
import sys
sys.stdout.write("hello world")
What will be the output of the following Python code?
x = "abcdef"
i = "a"
while i in x[:-1]:
print(i, end=" ")
When is the else
block of a try-except-else
statement executed?
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?
What will be the output of the following Python code?
print(math.isinf(float('-inf')))
How do you create a private variable in a Python class?
print "how old are you? (in years)"
age = raw_input()
print "how tall are you? (in ft & inches)"
height = raw_input()
print "you are %r years old and %r tall" % (age,height)
#21 years and 5'6" are the input from the users