#๐Ÿ”’ how do i restart code after an if command?

17 messages ยท Page 1 of 1 (latest)

amber crypt
#

ive been struggling on this for ages how do i fix name restart is not defined. also please ignore the name its a joke ๐Ÿ˜ญ

it goes like this

choose= input()

print("""f
[1] xyz
[2]. zyx
[3]. xyyz \n
""")

if choose== "1":
print(xxxyyyzzz)

if choose== "2":
print(xxxyyyzzz)
--restart==True

if choose== "3":
print(xxxyyyzzz)
--restart==True

mighty beaconBOT
#

@amber crypt

Python help channel opened

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.

clear echo
#

just make that all a function and add it to a while loop

green totem
amber crypt
amber crypt
lyric jay
remote belfry
#

where did you get that --restart anyway?

amber crypt
clear echo
#
restart = True
def paste_ur_code_here_inside(args, idk):
    global restart

    if (condition): restart = True
    else: restart = False

while restart:
    paste_ur_code_here_inside(args, idk)```
mighty beaconBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.