Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS IS WRITTEN IN A PYTHON COMPILER, PLEASE STICK TO PYTHON. I think I just need help with debugging! I will post my solution under

THIS IS WRITTEN IN A PYTHON COMPILER, PLEASE STICK TO PYTHON.

I think I just need help with debugging!

I will post my solution under the assignment requirements, but for context, I wrote this code originally on an online python compiler but when I run it through IDLE it comes up with an error. Please help me debug so it works in IDLE and please let me know what I did wrong. Thank you.

ASSIGNMENT REQUIREMENTS:

---Create code based on the given scenario

---Must use AND and OR

Given scenario: If it is Wednesday or Saturday and the club house is open and the kids want to go swimming, then take them swimming. Otherwise just stay home.

MY SOLUTION:

club_house = input('Is the club house open? y: ') week_day = input('What day of the week is it?: ') go_swim = input('Do the kids want to swim? y: ')

if club_house == 'y': club_house = 1 else: club_house = 0 if week_day == 'Monday': week_day = 0 elif week_day == 'Tuesday': week_day = 0 elif week_day == 'Wednesday': week_day = 1 elif week_day == 'Thursday': week_day = 0 elif week_day == 'Friday': week_day = 0 elif week_day == 'Saturday': week_day = 0 else: week_day = 1

if go_swim == 'y': go_swim = 1 else: go_swim = 0 if (club_house == 1) and (week_day == 1) and (go_swim == 1): print('Today is Wednesday or Sunday so the club pool should be open and the kids want to go swimming.') 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.')

ERRORS FROM IDLE:

image text in transcribed

Python 3.11.1 (v3.11.1:a7a450f84a, Dec 62022,15:24:06 ) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin Type "help", "copyright", "credits" or "license( ) " for more information. club_house = input(' Is the club house open? y: ") week_day = input('What day of the week is it?: ') go_swim = input('Do the kids want to swim? y : ') if club_house ==y : club_house =1 else: club_house =0 if week_day == 'Monday': week_day =0 elif week_day == 'Tuesday": week_day =0 elif week_day == 'Wedneday': week_day =1 elif week_day == 'Thursday': week_day =0 elif week_day == 'Friday': week_day =0 elif week_day == 'Saturday': week_day =0 else: week_day =1 if go_swim == ' y ': go_swim =1 else: go_swim =0 If (club_house ==1 ) and (week_day ==1 ) and ( go_swim ==1) : print('Today is Wednesday or Sunday so the club pool should be open and the kids want to go swimming. ') elif ( club_house ==1 ) and (week_day ==1 ) and (g 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, ') Syntaxerror: multiple statements found while compiling a single statement

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

Students also viewed these Databases questions

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago

Question

Describe the sources of long term financing.

Answered: 1 week ago