Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. Create a tuple that contains course codes: (2400', '3560', '3140', '3040','4100', '4700', '4500) Do the following: a) Convert the tuple to a tuple that
4. Create a tuple that contains course codes: (2400', '3560', '3140', '3040','4100', '4700', '4500") Do the following: a) Convert the tuple to a tuple that changes the course abbreviations to full course names with the COMP-): ("COMP-2400', 'COMP-3560', 'COMP-3140", "COMP-3040", "COMP-4100', 'COMP-4700', 'COMP-4500"). Print it b) Let Python randomly select a course and print the course. c) Finally, make a new tuple with the randomly selected course replaced by the word "LuckyCourse" in the tuple. Print the new tuple. Running example: The original tuple of abbreviation is: (2400', '3560', '3140', '3040', '4100', '4700', '4500') The tuple of full-name is: (COMP-2400', 'COMP-3560', 'COMP-3140', 'COMP-3040', 'COMP-4100', 'COMP-4700', 'COMP-4500') Your lucky course is: COMP-4700 The new tuple is: (COMP-2400', 'COMP-3560', 'COMP-3140', 'COMP-3040', 'COMP-4100', 'luckyCourse', 'COMP-4500')
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