Hello PHC Fam, Ano po kaya idadagdag ko dito na code? Ito po yung isa sa pinapagawa samin.
1.Year must be from included 1980-2014. Should the user inputs outside the range, the program will throw a ValueError.
1.Year must be from included 1980-2014. Should the user inputs outside the range, the program will throw a ValueError.
Python:
Year = int(input("Year: "))
if (Year - 2000) % 12 == 0:
chinesezodiac_sign = 'Dragon'
elif (Year - 2000) % 12 == 1:
chinesezodiac_sign = 'Snake'
elif (Year - 2000) % 12 == 2:
chinesezodiac_sign = 'Horse'
elif (Year - 2000) % 12 == 3:
chinesezodiac_sign = 'sheep'
elif (Year - 2000) % 12 == 4:
chinesezodiac_sign = 'Monkey'
elif (Year - 2000) % 12 == 5:
chinesezodiac_sign = 'Rooster'
elif (Year - 2000) % 12 == 6:
chinesezodiac_sign = 'Dog'
elif (Year - 2000) % 12 == 7:
chinesezodiac_sign = 'Pig'
elif (Year - 2000) % 12 == 8:
chinesezodiac_sign = 'Rat'
elif (Year - 2000) % 12 == 9:
chinesezodiac_sign = 'Ox'
elif (Year - 2000) % 12 == 10:
chinesezodiac_sign = 'Tiger'
else:
chinesezodiac_sign = 'Hare'
print("Your Chinese Zodiac is", chinesezodiac_sign)
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.