Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Describe the team dynamics at Facebook.

Answered: 1 week ago

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago