Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started