Question 11
Question 12: Find the output of the following program:
list = ['python', 'learning', '@', 'Geeks', 'for', 'Geeks']
print(list[0:6:2])
Question 12
Find the output of the following program:
d1 = [10, 20, 30, 40, 50]
d2 = [1, 2, 3, 4, 5]
subtracted = list()
for d1, d2 in zip(d1, d2):
item = d1 -d2
subtracted.append(item)
print(subtracted)
Question 13
Find the output of the following program:
list = ['a', 'b', 'c', 'd', 'e']
print(list[10:] )
Question 14
Question 15: Find the output of the following program:
list = ['a', 'b', 'c'] * -3
print(list)
Question 15
Find the output of the following program:
data = [2, 3, 9]
temp = [[x for x in[data]] for x in range(3)]
print (temp)
Question 16
Find the output of the following program:
data = [x for x in range(5)]
temp = [x for x in range(7) if x in data and x%2==0]
print(temp)
Question 17
Find the output of the following program:
temp = ['Geeks', 'for', 'Geeks']
arr = [i[0].upper() for i in temp]
print(arr)
Question 18
Question 19: Find the output of the following program:
temp = 'Geeks 22536 for 445 Geeks'
data = [x for x in (int(x) for x in temp if x.isdigit()) if x%2 == 0]
print(data)
Question 19
Find the output of the following program:
data = [x for x in (x for x in 'Geeks 22966 for Geeks' if x.isdigit()) if
(x in ([x for x in range(20)]))]
print(data)
Question 20
Find the output of the following program:
L1 = []
L1.append([1, [2, 3], 4])
L1.extend([7, 8, 9])
print(L1[0][1][1] + L1[2])
There are 24 questions to complete.