How to fix my if, elif, else statement in python? -


I am working on an omeg simulator for fun, where it asks for your age and if you are old then you Asks whether the kick is. It works fine that you are 16 or older, but if you say less than that, then it comes with an error This code is:

  age = input ("age ? \ N ") If age ==" 1 ": print (" very young BB ") elif age ==" 2 ": Print (" Very young BB ") Elife Edge ==" 3 ": Print (" Very young Elife age == "4": print ("very young BB") elif age == "5": Print ("Very young BB") Elife Edge == "6": Print ("Very young BB" ) Elife Edge == "7": Print ("Very young BB") elif age == "8": Print ("very young BB") elif age == "10": print ("very young BB") elif age == "11": print ("Very young BB" "Elif age ==" 12 "Print" ("very young BB") Elife's age == "13": print ("very young BB") Elif age == "14": print ("very young BB") Yes "yes" if kik == Yes: Print ("Add me BB"): Print ("Bye")  

An error occurs:

  Traceback (most recent call final ): File "C: / User / Public / Document / Python / Omeg Le of .py ", line 36, & lt; module & gt; If kik == Yes: Name: Error: Name 'kick' is not defined  

Does anyone know how to fix it?

The problem is that you only set kik in this block: < / P>

  else: kik = input ("do if you do not have any blocks, then  kik  does not exist. An option is to set it before your / if elif blocks Additionally, you can do a lot of it: 

kik = "no" age = input ("age? \ N") if int (Age) <16: Print ("Very young BB") and: kik = Input ("What do you have? \ N") Yes = "Yes" if kik == yes: Print ("Add me BB") Other: Print ("Bye")

Comments