To Err is Human: Identify the error/errors in the given code to apply the function ( x ∗ y + x + y ) on x , y and finally return the value.
func(x, y):
z = x * y + x + y
func(2)
(More than one option may be correct.)
func(x, y):
z = x * y + x + y
func(2)
(More than one option may be correct.)
d = {x.upper(): x*3 for x in 'acbd'}
print(d)
print([i+j for i in "abc" for j in "def"])
input_list = list(range(1,100))
output_dict = {}
for val in input_list:
if val % 3 == 0:
output_dict[val] = val**3
Now, what would be corresponding dictionary comprehension for the code involved in dictionary creation?
d = {0: 'Fish', 1: 'Bird', 2: 'Mammal'}
for i in d:
print(i)
[Assume that the lists are of the same length.]
L1 = [10, 20, 30, 24, 18]
L2 = [8, 14, 15, 20, 10]
L3=[]
for i in ##1###:
L3.###2##
L3
if True or True:
if False and True or False:
print('A')
elif False and False or True and True:
print('B')
else:
print('C')
else:
print('D')
if (10 < 0) and (0 < -10):
print("A")
elif (10 > 0) or False:
print("B")
else:
print("C")
Given the code below, the output obtained in several runs is 'C' 'A' 'D' 'B'.
if score >= 90:
print('A')
elif score >=80:
print('B')
elif score >= 70:
print('C')
elif score >= 60:
print('D')
else:
print('F')