Guest User

Untitled

a guest
Apr 24th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def cpto(lvl,cap,goal):
  2. """
  3. Function to find out the amount of change points required to reach a level.
  4. Returns said amount.
  5. lvl: Starting level, and used as level tracking within function
  6. cap: The level at which CP required to reach next level stops increasing
  7. goal: The goal, self-explanatorily.
  8. """
  9. tot=0
  10. while not lvl==goal:
  11. if lvl<cap:
  12. tot+=(lvl+1)
  13. lvl+=1
  14. else:
  15. tot+=cap
  16. lvl+=1
  17. return tot
  18. print(cpto(0,50,77))
Advertisement
Add Comment
Please, Sign In to add comment