What is the output of print(math.copysign(3,-1)) ?
Keyword for defining the function in python?
l = [1, 2, 3, 4, 5, 7]
print(l[::2])
What will be the output of the following Python expression if x=456?
print("%-06d"%x)
What will be the output of the following Python code?
m = re.search('a', 'The blue umbrella')
m.re.pattern
Which of the following functions can be used to make the arrow black?
What will be the output of the following Python code?
a= [1, 2, 3, 4, 5]
for i in range(1, 5):
a[i-1] = a[i]
for i in range(0, 5):
print(a[i],end = " ")
What will be the output of the following Python code snippet?
X = "san-foundry"
print("%56s" % X)
What is the use of duck typing?
What will be the output of the following Python code?
names1 = ['Amir', 'Bear', 'Charlton', 'Daman']
names2 = names1
names3 = names1[:]
names2[0] = 'Alice'
names3[1] = 'Bob'
sum = 0
for ls in (names1, names2, names3):
if ls[0] == 'Alice':
sum += 1
if ls[1] == 'Bob':
sum += 10
print sum