you are helping an army. if you don't send supplies, you would die. if the food drops to 0 all would die. if you run out of iron, the army could not fight. you will start with 100 food and 100 iron. it takes 10 seconds to produce 1 food and 100 seconds to produce 1 iron.The army eats 1 food every 60 sec.
food = 100 iron = 100 timestep = 0 max_time = 100000 while food > 0 and iron > 0 and timestep < max_time: time.sleep(10) food = food + 1 time.sleep(100) iron = iron + 1 time.sleep(60) food = food - 1 timestep = timestep + 1 print(food, iron, timestep)