Question: Question 3: Do as directed. a. What is the difference between discard() and remove () methods when applied to a set? (2.5 Marks) b. What

Question 3: Do as directed. a. What is the difference between discard() and remove () methods when applied to a set? (2.5 Marks) b. What is the difference between add() and update () methods when applied to a set? (2.5 Marks) c. Consider the code given below. write down the correct version by identifying and removing/correcting all the errors. (5 Marks) Function must retum lst as a tuple. def Func2() lst=tuple (2) 1st[0]=4 return lst d. Consider the code given below. write down the correct version by identifying and removing correcting all the errors. (5 Marks) Code must print the birth of year of each person in the format as given below: (Asif was born in 1977) names = ['Asif', 'Kamran', 'Ali', Kashif', 'Nouman'] ages [45, 32, 18, 38, 31] current year 2021 for person in range (6) age = ages (person) name = names (person] year of birth current year print('name' + ! was born in + year of birth age + 1 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
