1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
def __init__( self , name, gender, hp,attack, mp,exp,level): '''Use double underscores''' #This method initializes the attibutes of the Character class self .name = name self .gender = gender self .hp = hp self .attack = attack self .mp = mp self .exp = exp self .level = level #these are the Character's stats. def __str__( self ): return ( str ( self .name) + ": level " + str ( self .level) + + str ( self .hp) + " hp, " ) '''To be used in battle''' def level_check( self ): if self .level = = 0 : level_exp = 50 if self .exp> = level_exp: self .level = self .level + 1 level.exp = level.exp * 3 stat_points = 5 while stat_points> 0 : #put something here later chara1 = Chara( input ( "What is your name?" ), input ( "Are you a boy or a girl? \n\t 1. Boy \n\t 2. Girl" ), 9 , 3 , 0 , 0 , 0 ) |
Bad input
Bad input
|
||
May-14-2020, 10:12 AM
Don't post multiple threads, and use proper code tags please.
Can you show the line 53 of your code?
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela Need help on the forum? Visit help @ python forum For learning more and more about python, visit Python docs
May-14-2020, 03:59 PM
May-14-2020, 04:21 PM
The error is on line 52 where you don't have anything inside the while statement. Just add a "pass" command to stub out the code for later
May-15-2020, 05:55 AM
(May-14-2020, 03:59 PM)Impropabletank Wrote: Also, I did not think that I posted it twice.https://python-forum.io/Thread-Bad-input
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela Need help on the forum? Visit help @ python forum For learning more and more about python, visit Python docs | ||
|
Users browsing this thread: 1 Guest(s)