Jul-02-2018, 08:30 PM
Total beginner.
Cant get the last line to work as intended.
want it to print the text and the value
something like this
alpha 5
Also i don't understand exactly how the alpha and bravo blocks work
stole the code from another post
just that they seem to hold the values and i'm able to call them elsewhere
so a quick explanation would be appreciated.
thanks in advance
Cant get the last line to work as intended.
want it to print the text and the value
something like this
alpha 5
Also i don't understand exactly how the alpha and bravo blocks work
stole the code from another post
just that they seem to hold the values and i'm able to call them elsewhere
so a quick explanation would be appreciated.
thanks in advance
### fighter stats ### def alpha(*values): alpha.values = values or alpha.values return alpha.values alpha.values =() def bravo(*values): bravo.values = values or bravo.values return bravo.values bravo.values =() alpha(5, 3, 2) a, b, c = alpha() bravo(2, 5, 3) d, e, f = bravo() def intro(): fighter = "" while fighter != 1 and fighter != 2: print ("Choose a fighter 1)Alpha 2)Bravo") print (a, b, c, d, e, f) fighter = input() print (a + e) print (a + 1) print (e + 2) print ("alpha " ) + (a) ### tried several different ways of writing this last line ### ### can't get it to work ### return fighter