What is the mistake in this code ? Why I am not geting the desired output?
import random def ketonattack(): list_g = ["Keton used leaf slash","Keton hit you with a kick ","keton used head butt","keton used sling shot"] l = random.choice(list_g) if l == list_g[0]: print(list_g[0]+" Your monsto got damage of 30%\n [///////]") elif l == list_g[1]: print(list_g[1]+ "Your monsto got Critical damage of 70%\n [///]") elif l == list_g[2]: print(list_g[2]+" Your monsto got damage of 10%\n [////////]") elif l == list_g[3]: print(list_g[3]+" Your monsto dodge the attack\n [//////////]") else: print("error") ketonattack() Output:- Traceback (most recent call last): File "source_file.py", line 4, in <module> l = random.choice(list_g) NameError: name 'list_g' is not defined Process finished with exit code 1.