vendredi 30 avril 2021

How do i run rest of the code out of a loop

Look in my code how can i do that

a = int(input("enter a number"))
if a == 5:
    # from here i want to continue below code
else:
   print("a is not 5")
   exit()

#code is here

what i have already tried:

  1. putting it empty
if a == 5:
else:
   print("a is not 5")
   exit()

#code is here
  1. putting a comment
if a == 5:
    # from here i want to continue below code
else:
   print("a is not 5")
   exit()

#code is here

Aucun commentaire:

Enregistrer un commentaire