Page 1 of 1

Please answer this question using only "and", "or" and "not". Please do not use the "if", "elif" or "else" to answer thi

Posted: Sat May 14, 2022 7:45 pm
by answerhappygod
Please answer this question
Please Answer This Question Using Only And Or And Not Please Do Not Use The If Elif Or Else To Answer Thi 1
Please Answer This Question Using Only And Or And Not Please Do Not Use The If Elif Or Else To Answer Thi 1 (410.45 KiB) Viewed 37 times
using only "and", "or" and "not". Please do not use the "if", "elif" or "else" to answer this.
Please Answer This Question Using Only And Or And Not Please Do Not Use The If Elif Or Else To Answer Thi 2
Please Answer This Question Using Only And Or And Not Please Do Not Use The If Elif Or Else To Answer Thi 2 (429.66 KiB) Viewed 37 times
ImSoSorry py Submit Run Grades Reset [Executed at: Mon May 9 12:11: 12 PDT 2022] 1 exam = False 2 sunny = False 3 sunblock = False 4 morning classes = True 5 night_classes = True 6 raining = False 7 rain jacket = True 8 snowing = False 9 friends_are_going = True 10 fluffy coat = False 11 snow boots = True 12 really want_to_go = True 13 14 #You may modify the lines of code above, but don't move them! 15 #When you Submit your code, we'll change these lines to 16 #assign different values to the variables. 18 #Imagine you commute to your classes and want to write code to 19 #determine when it is appropriate for you to go to class based 20 #on the following conditions: We found a few things wrong wi th your code. The first one is shown below, and the rest can be found in full results.txt i n the dropdown in the top lef t: We tested your code with exam False, sunny = False, sunblo ck = True, morning classes = T rue, night_classes = False, ra ining = True, rain jacket = Fa lse, snowing = True, friends_a re_going = True, fluffy coat = True, snow_boots = False, real ly_want_to_go = False. We expe cted your code to print this: True or false: I should go to class: True However, it printed this: 22 # - If you have an exam, then you should go to class, regardless 23# of the weather. 24 # - If you do not have an exam and it is sunny outside, then you 25 # want to go to class if either of the following are true: you 26 # have sunblock and your classes are in the morning or your classes are at night. 28 # - If you do not have an exam and it is raining outside, then 29 you want to go to class if you have a rain jacket, 30 # - If you do not have an exam and it is snowing, then you want, 31 # to go if any of the following are true: your friends are 32 # 33 # Fluffy coat, or you just really want to go to class. 34 35 #If none of the previously stated conditions are true, then you 36 do not want to go to class. 37 38 #Once you have determined if you should go to class, print the 39 #following statement without the quotation marks, where 40 #corresponds to the boolean that you have found 41 #"True or false: I should go to class a a True or false: I should go to class: False

ImSoSorry.py Submit Run Grades Reset TELE TU 15 #When you Submit your code, we'll change these lines to 16 #assign different values to the variables. [Executed at: Mon May 9 12:11: 12 PDT 2022] We found a few things wrong wi th your code. The first one is shown below, and the rest can be found in full results.txt i n the dropdown in the top lef 18 #Imagine you commute to your classes and want to write code to 19 #determine when it is appropriate for you to go to class based 20 #on the following conditions: 21 # 22 # - If you have an exam, then you should go to class, regardless 23 # of the weather. 24 # - If you do not have an exam and it is sunny outside, then you 25 # want to go to class if either of the following are true: you 26 # have sunblock and your classes are in the morning or your 27 # classes are at night 28 # - If you do not have an exam and it is raining outside, then 29 # you want to go to class if you have a rain Jacket. 30 If you do not have an exam and it is snowine, then you want 31 # to go if any of the following are true: your friends are 32 = going and you have a fluffy coat, you have snow boots and a fluffy coat, or you just really want to go to class. 34 35 #If none of the previously stated conditions are true, then you 36 do not want to go to class. 37 38 #Once you have determined if you should go to class, print the 39 #following statement without the quotation marks where 40 corresponds to the boolean that you have found 41 True or false. I should go to class: 22 43 #Add your code bere! #with the initial inputsui moun pode 44 #shouid print: 45 #True or False: I should go to classe faisie 46 have_exam = exam and sunny or raining or snowing 47 no exam1 = (exam and sunny) and (sunblock and morning classes or night_classes) 48 no_exam2 = exam and raining and rain_jacket 49 no_exam3 = exam and snowing and friends_are_going and fluffy_coat) and (snowboots and fluffy_coat) or really want_to_go 50 want_to_go = have_exam and no_examl and no_exam2 and no exam3 51 print("True or false: I should go to class, want_to_go) 52 We tested your code with exam = False, sunny = False, sunblo ck = True, morning classes = T rue, night_classes = false, ra ining = True, rain jacket = Fa Ise, snowing = True, friends a re going = True, fluffy_coat = True, snow_boots = False, real ly_want_to_go = False. We expe cted your code to print this: 33 # True or false: I should go to class: True However, it printed this: True or False: I should go to class: False