Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Am I dumb?
#1
I am relatively new to python, and I thought I understood the basics of it already, but for some reason, this one block of code is giving me so many problems. I cannot find the problem with this code, as it just keeps looping for seemingly no reason. What am I doing wrong here? I know this code can be optimized by the way, it was optimized but after it kept looping I thought I would take it back to the basics and that would fix it, but I was wrong.



user_choice = ""
run_loop = "run"

while run_loop == "run":
    print()
    
    if user_choice.lower == "option 1":
        run_loop = "off"
    elif user_choice.lower == "option 2":
        run_loop = "off"
    elif user_choice.lower == "option 3":
        run_loop = "off"
    elif user_choice.lower == "option 4":
        run_loop = "off"
    elif user_choice.lower == "option 5":
        run_loop = "off"
    else:
        print("Here are your options:")
        user_choice = input("Option 1, Option 2, Option 3, Option 4, or Option 5: ")
Reply


Messages In This Thread
Am I dumb? - by aidh18 - Mar-22-2022, 09:55 PM
RE: Am I dumb? - by Gribouillis - Mar-22-2022, 10:06 PM
RE: Am I dumb? - by deanhystad - Mar-22-2022, 10:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dumb newbie question JonEdward 5 3,332 Jul-22-2020, 10:06 PM
Last Post: snippsat
  Simple script writted by a dumb dude, myself mm14ag 2 2,792 Apr-28-2018, 11:48 AM
Last Post: mm14ag

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020