DiYane

Next version

Sep 25th, 2023
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. version = input()
  2.  
  3. n1, n2, n3 = map(int, version.split('.'))
  4. n3 += 1
  5.  
  6. if n3 > 9:
  7.     n3 = 0
  8.     n2 += 1
  9.  
  10. if n2 > 9:
  11.     n2 = 0
  12.     n1 += 1
  13.  
  14. next_version = f"{n1}.{n2}.{n3}"
  15. print(next_version)
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment