Guest User

new

a guest
Feb 4th, 2024
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. sign_12 ={1:'子', 2:'丑', 3:'寅', 4:'卯', 5:'辰', 6:'巳', 7:'午', 8:'未', 9:'申', 10:'酉', 11:'戌', 0:'亥'}
  2. year = int(input('西暦:'))
  3. ret = (year - 3) % 12
  4. for n, sign in sign_12.items():
  5.     if n == ret:
  6.         str_sign = sign
  7.  
  8. print(f'{year}年の十二支は{str_sign}です。')
Advertisement
Add Comment
Please, Sign In to add comment