Sep-25-2017, 07:58 PM
I'm really new to python. Can someone help me figure out what's wrong with my crappy game? It says NameError: name 'DSC' is not defined on line 55 in main.py
import time import os name = raw_input("""Hello, welcome to Snek World. You are a snek what is your name? """) time.sleep(1) print 'Hi, %s Welcome to Snek World' % name time.sleep(2) # Pick a Biome print """Here in Snek World we have tons of different biomes! Pick where you want to live. (Sneks vary in each biome.) 1. Desert 2. Rainforest 3. Plains """ biome = int(raw_input()) time.sleep(2) os.system('cls') # Desert Snakes (DSC = Desert snake choice) if biome == 1: DSC = raw_input("""Good choice! There are lots of sneks from the desert! (Pick which snek you want to be) 1. Kenyan Sand Boa 2. Cobra 3. California King Snake """) # Rainforest snakes (RSC Rainforest snek choice) elif biome == 2: RSC = input("""Good choice! There are lots of sneks from the rainforest! (Pick which snek you want to be) 1. Tri-color hognose 2. Rainbow Boa 3. Bush Viper """) # Plains (PSC Plains snek choice) elif biome == 3: PSC = input("""Good choice! There are lots of sneks from the plains! (Pick which snek you want to be) 1. Hognose snake 2. Diamondback rattlesnake 3. Rat snake """) # DSC if DSC == 1: print '%s the Kenyan sand boa, I like it!' % name if DSC == 2: print '%s the Cobra, I like it!' % name if DSC == 3: print '%s the California king snake, I like it!' % name # RSC if RSC == 1: print '%s the Tri-color hognose, I like it!' % name if RSC == 2: print '%s the Rainbow boa, I like it!' % name if RSC == 3: print '%s the Bush viper, I like it!' % name # PSC if PSC == 1: print '%s the Hognose snake, I like it!' % name if PSC == 2: print '%s the Diamondback rattlesnake, I like it!' % name if PSC == 3: print '%s the Rat snake, I like it!' % name