Python-Quizzes | Python List Quiz | Question 13
Find the output of the following program:
Python3
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)
|
(A)
[10, 20, 30, 40, 50]
(B)
[1, 2, 3, 4, 5]
(C)
[10, 20, 30, 40, 50,-1, -2, -3, -4, -5]
(D)
9, 18, 27, 36, 45
Answer: (D)
Explanation:
The output will be-9, 18, 27, 36, 45
Quiz of this Question
Please comment below if you find anything wrong in the above post
Last Updated :
17 Sep, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...