0

Is there any code in Python i can use to jump back in the beginning of the code without using functions? E.g:

Beginning:

num_greet = 2

While num_greetings <= 2:

      print("Hi my name is Joe")
else:
     print("Type a number that is less than 2")

     goto Beginning
Sayse
  • 42,633
  • 14
  • 77
  • 146
  • 2
    One of the best things about python is that it doesn't have `goto`, what exactly are you trying to do? – Sayse Jan 08 '20 at 22:02
  • A better-placed while loop that starts at the first line? – DavidW Jan 08 '20 at 22:08
  • The code you've posted makes no sense. Even if all the typos and syntax errors were corrected, the else-block would never be entered because `num_greetings` never changes. – ekhumoro Jan 08 '20 at 22:15
  • https://github.com/JoeDimumbi/Password-Generator/blob/master/Password_Gen.py I'm trying to use the "goto" on the password generator above – CrunchyCoder52 Jan 08 '20 at 23:22

0 Answers0