>>> x="122"
>>> x.zfill(7)
What does the above code print?
What will be the output of the following Python code?
What will be the output of the following code?
a=(1,2,3,4,5)
a.append(10)
print(len(a))
What will be the output of the following Python code?
What is the output of the following code?
def fun(*args):
print(args)
fun(1,5,57,8,56)
The output of the following two Python codes are the same.
CODE 1
>>> re.split(r'(a)(t)', 'The night sky')
CODE 2
>>> re.split(r'\s+', 'The night sky')
The output of executing string.ascii_letters can also be achieved by:
Find the output of the following code:
class Car:
def __init__(self, speed, color):
print(speed)
print(color)
print("the __init__ is called")
tesla = Car(200, 'red')
Find the output of the following code.
def fun():
def fun1():
a = 1234
def fun2():
global a
a = 4567
a = 2468
fun1()
print(a)
fun2()
print(a)
fun()
print(a)
What will be the output of the following Python code snippet?
print([[i+j for i in "abc"] for j in "def"])