Question: Please help me how i can turn this into a list... so i far i have this year_msg = int(input(What is the year that you

Please help me how i can turn this into a list... so i far i have this

year_msg = int(input("What is the year that you want to convert? "))

year_formula = (year_msg + 9) % 12

if year_formula == 1: print("This is the year of the Rat.") elif year_formula == 2: print("This is the year of the Ox.") elif year_formula == 3: print("This is the year of the Tiger.") elif year_formula == 4: print("This is the year of the Rabbit.") elif year_formula == 5: print("This is the year of the Dragon.") elif year_formula == 6: print("This is the year of the Snake.") elif year_formula == 7: print("This is the year of the Horse.") elif year_formula == 8: print("This is the year of the Goat.") elif year_formula == 9: print("This is the year of the Monkey.") elif year_formula == 10: print("This is the year of the Rooster.") elif year_formula == 11: print("This is the year of the Dog.") else: year_formula == 12 print("This is the year of the Pig.")

and this pretty much tells you the years chinese zodiac sign but i am having trouble making this into a list and say the same exact thing like this

and I cannot have "if" statements in this code where i got stuck and cannot figure out how to do this with for loops, this is what the instuction is

Please help me how i can turn this into a list... so

Remember that the years in order are: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, Pig Put these into a list, and then access the proper element via a list rather than a lot of if statements. The only if statement in your code should be the if_name__ == '_main__': linux [0] $ python3 What is the year that you want to convert? 3022 Horse linux [0] $ python3..... What is the year that you want to convert? 2081 Ox linux [0] $ python3 ---3.py What is the year that you want to convert? 1847 Goat

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!