fork download
  1. # your code goes here
  2. divida = int(input())
  3. maximo = int(input())
  4. while divida > 0:
  5. print("(antes) {}".format(divida))
  6. if divida <= maximo:
  7. divida = 0
  8. else:
  9. divida -= maximo
  10. print("(depois) {}".format(divida))
  11.  
Success #stdin #stdout 0.02s 9304KB
stdin
150
50
stdout
(antes) 150
(depois) 100
(antes) 100
(depois) 50
(antes) 50
(depois) 0