#๐ how to make so my while loop only prints once and once again once the menu is opene again
14 messages ยท Page 1 of 1 (latest)
@valid sage
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
it prints a whole lot of time
You need to stop the while loop
I will set your code and share it with you.
while is_running:
print("Choose something")
print("1. Withdraw")
choice = input("Option: ")
if choice == "1":
print("Processing withdrawal...")
else:
print("Not a valid option")
is_running = False # This ensures the loop runs only once
Hey @wet citrus!
Add a py after the three backticks.
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
thanks sir
I share the code you can see that.
Is it OK? after once loop is running you need to enter a one variable in which you set it to a False Value
If you need any kind of further help DM me
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.