Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. number = int(input())
  2. x = number % 10
  3. y = number // 10
  4. result = ''
  5.  
  6.  
  7. if y <= 3:
  8.     result += "X"*y
  9. elif y == 4:
  10.     result += "XL"
  11. elif y <= 8 and y >=5:
  12.     result += "L" + "X"*(y-5)
  13. elif y == 9:
  14.     result = "XC"
  15. elif y == 10:
  16.     result = "C"
  17.  
  18. if x <= 3:
  19.     print("I"*x)
  20. elif x == 4:
  21.     print("IV")
  22. elif x <= 8 and x >=5:
  23.     print("V" + "I" *(x-5))
  24. elif x == 9:
  25.     print("IX")
  26. elif x == 10:
  27.     print("X")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement