Question
NEED HELP WITH DEBUGGING! I will post my solution and assignment requirements below. I think I have the idea right, but I just need help
NEED HELP WITH DEBUGGING!
I will post my solution and assignment requirements below. I think I have the idea right, but I just need help with making sure the logic is correct. Please explain what I am doing wrong. I WANT TO LEARN so please be as detailed as you can. I appreciate any help!
Important:
Needs to be written in python
Needs to run successfully in IDLE compiler
Assignment Requirements:
-Needs to contain lists
-Needs to contain a function
-Needs to contain either (AT LEAST):
---2 ANDs and 1 OR
OR
---2 ORs and 1 AND
******* You can add more if needed ******
This is My Solution below:
day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
club_house = input('Is the club house open? y/n: ') week_day = input('What day of the week is it?: ') go_swim = input('Do the kids want to swim? y/n: ')
if club_house == 'y': club_house = 1 else: club_house = 0
if week_day == day[2] or day[6]: week_day = 1 else: week_day = 0
if go_swim == 'y': go_swim = 1 else: go_swim = 0
def goSwimming(): if (club_house == 1) and (week_day == 1) and (go_swim == 1): print("It is Wednesday or Sunday, so the pool is open. The kids want to go swim.") elif (club_house == 1) and (week_day == 1) and (go_swim == 0): print('Today is Wednesday or Sunday and the club pool is open, but the kids do not want to swim') elif ((club_house ==0) or (week_day == 0)) and (go_swim == 1): print('The club pool is closed, but the kids want to swim. Should we take them to do something else?') elif(club_house == 0) and (week_day == 0) and (go_swim == 0): print('The club and pool are closed, but I do not think the kids wanted to swim anyway.') else: print('The club is open, but the pool is closed. I do not think the kids wanted to go swimming anyway.') goSwimming()
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