a = [[3, 4, 5], 3]
a = sum(a)
print(a)
Which method is used to add a entire list to a list.
Which Python module supports regular expressions?
What does the abbreviation 'WTF' stand for?
What will be the output of the following Python code snippet?
print('ab cd ef'.title())
Given the following code:
list1=[1,2,3,4]
list2=[5,6,7,8]
for a,b in zip(list1,list2):
print(a,b)
What will be the output of the following Python code?
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2
What is the output of the following code?
a = 11_22_33_44_55
b = 11,22,33,44,55
print(type(b))
print(type(a))
What will be the output of the following code?
class sem:
pass
sem1 = sem()
sem2 = sem()
sem3 = sem()
sem1.am1 = 70
sem2.am2 = 80
sem3.am3 = 65
sem1.ap1 = 65
sem2.ap2 = 70
sem3.ds = 80
print(sem1.am1)
print(sem3.ds)
Point out the error (if any) in the code shown below if the system date is 18th June, 2017?
tday=datetime.date.today()
bday=datetime.date(2017,9,18)
till_bday=bday-tday
print(till_bday)