Advertisement
Nenogzar

Untitled

Sep 14th, 2023
859
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. n = float(input("`Number is: "))
  2. procent=int(input("%: "))
  3. f = n
  4. f1 = n
  5. r = n
  6.  
  7. procent_int = float (procent / 100)
  8. print(f"1: десетичен процент {procent_int}")
  9. procent_invert = float(1 - procent_int)
  10. print (f"2: procent_invert {procent_invert}")
  11.  
  12. g = n - (n * procent_int)
  13. print(f"3: приспадане на процента: {n} - ({n} * {procent_int}) = {g}")
  14.  
  15. f *= procent_invert
  16. print(f"4: приспадане на процента: {n} *= {procent_invert} = {f}")
  17.  
  18. f1 = n + (n * procent_int)
  19. print(f"5: Добавяне на процент:  {n} + {n} n->{n}* {procent_int}) = {f1}")
  20.  
  21. r -= procent_invert
  22. r1 = n - f
  23. r2 = n - f1
  24. print(f"6: {n} -= {n} * {procent_int} = {r:.2f}")
  25. print(f"7: {r2}")
Tags: percent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement