Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. (20 points) Asume that we have three types of classes in a gym that repeat every week. Whenever a student attends a class, we

image text in transcribed
5. (20 points) Asume that we have three types of classes in a gym that repeat every week. Whenever a student attends a class, we add their names to a list. If a student attends a class multiple weeks, we add their names multiple times, At the end of a month, the lists might look like these (your program should work for any combination of these lists): yoga_1ist = ['Anne', 'Any', 'Bob', 'Amy', 'Zach', 'Ali', 'David', 'Al1', 'Ayla', 'Bahar', 'Ayla'] pilates,list = ['Ayla', 'Amy', 'Bob', 'Any', 'Ali', 'David', 'Ali', 'Ayla', 'Eliz', 'Bahar', 'Ayla'] spin_1ist = ['Amy', 'Bob', 'Amy', 'Zach', 'Ali', 'David', 'Ali', 'Ayla', 'Eliz', 'Anne', "Ayla', 'Janess'] a) (7 pts) Write a program that finds and prints the total mamber of dasses Ayla has attended. (For the lists above, the answer should be 7.) b) (7 pts) Write a program that prints names of the students who attended all three claves at least once in a month. c) (6 pts) Write a program that prints names of the students who attended both spin and yoga chasses at least once, but did not attend pilates at all. Hint: For soune of the questions, couverting lists to sets might help you

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions