python - How to print the random.randrange number that was selected? -



python - How to print the random.randrange number that was selected? -

can't seem find reply this; example:

health -= random.randrange(0, 5)

how print out (edit: the console) number selected in range show how much health deducted?

it depends want print it... in add-on hope initialized health variable , utilize -= decrease it... if want print console have

print health #python 2.x

or

print(health) #python 3.x

of course of study have store random number selected

rand = random.randrange(0,5) print rand

python

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -