Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
02-28-2014, 06:10 AM #1
- Join Date
- Feb 2014
- Thanked 0 Times in 0 Posts
How to make python ignore undefined attributes.
Im working on a grid based zork game and am very new to coding. if i did something like this
location_y = 1 * limit_y
and limit_y is not defined, is there an easy way to make python ignore limit_y if it is not defined making location_y = 1
Thanks for the help! it is greatly appreciated.
03-21-2014, 12:32 PM #2
But that's not very nice. How about just starting with:Code:try: location_y = 1 * limit_y except: location_y = 1
Code:limit_y = 1
I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
** Independent Multimedia Artist in Pasig **