Python: Health regeneration | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Python: Health regeneration

Hi mates, I havent finishes the python course yet but I try very much. I have current problem. I want to create a health regeneration. That's the problems: if I use "print" I will get "1..2..3..4..5..6" But if I use "return" I will get nothing back. But the result needs to be changeable e.g. later if x == y: player_life() - poison Here is my Code: import time def player_life(): player_life = 70 regeneration = True while regeneration: player_life += 1 time.sleep(0.1) if player_life < 100: regeneration = True else: regeneration = False print(player_life) player_life() Do you have some help for me? btw. I would build a gui where the player would see the life points live

20th Dec 2017, 12:36 PM
SergeantChad
1 Answer