0

I can't get this if/elif/else statement to work where if I say no it goes directly to internet_type = "None":

wifi = 10
stay = 10
cable = 10

if (input("Internet Used (Y/N): ") == "Y" or "y" or "Yes" or "yes"):
        print("\u0332".join("Access Used"))
        print("1- Wi-Fi connection")
        print("2- Cable")
        choice = input("Enter Choice 1 or 2: W or C")
if(choice == "1" or "W" or "w"):
    internet_type = "Wi-Fi"
    total_internet = wifi * stay
elif(choice == "2" or "C" or "c"):
    internet_type = "Cable"
    total_internet = cable * stay
else:
    internet_type = "None"
    total_internet = 0

print(internet_type)
ShadowRanger
  • 143,180
  • 12
  • 188
  • 271
  • Please format your code by using the code format tool when posting code samples. – Joshua Hall Apr 21 '20 at 04:01
  • What do you expect? None of your if/else statements handle "no", so it goes to `else`, which is `internet_type="None"` – Frank Apr 21 '20 at 04:03
  • 1
    @Frank that's totally wrong. Please check out the link identified as a duplicate. There's no way the code as shown could reach the final `else:`. – Mark Ransom Apr 21 '20 at 04:31
  • Ohh I see. I just tried running your code, it doesn't go to `internet_type="None"` directly like you said, but it goes to `Enter Choice 1 or 2: W or C`. – Frank Apr 21 '20 at 19:18

0 Answers0