Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. zodiac = {'aries': 'compatible with Gemini, Sagittarius, Leo. business person.',##There are 12 keys with values that are each of the 12 zodiac signs. The values of each of the keys is for best romantic picks and jobs.
  2. 'leo': 'compatible with Sagittarius, Aries, Gemini. performer.',##I tried to arrange each key at beginning of line to look better.
  3. 'sagittarius': 'compatible with Aries, Aquarius, Leo. animal training.',##shortened some of the values from previously
  4. 'cancer': 'compatible with Taurus, Scorpio, Virgo. Social work.',
  5. 'scorpio': 'compatible with Cancer, Capricorn, Pisces. detectives.',
  6. 'pisces': 'compatible with Scorpio, Cancer, Capricorn. natural artists.',
  7. 'taurus': 'compatible with Cancer, Capricorn, Pisces. great teacher.',
  8. 'virgo': 'compatible with Taurus, Cancer, Capricorn. Great television critics.',
  9. 'capricorn': 'compatible with Taurus, Pisces, Virgo. good managers.',
  10. 'gemini': 'compatible with Pisces, Virgo, Scorpio. Architects.',
  11. 'libra': 'compatible with Pisces, Cancer, Taurus. diplomat.',
  12. 'aquarius': 'compatible with Sagittarius, Libra, Gemini. Scientist or inventor.',}
  13.  
  14. while True:##I placed everything in a while loop like you suggested to make the whole thing better.
  15. print('Hello and welcome to the zodiac compatibility and career wizard')##This is the initial welcome to the user
  16. print('These are the zodiac signs.')##lets user know list of keys are only ones
  17. for k in zodiac.keys():##prints keys
  18. print(k)
  19. print('Enter Your Sign: (blank to quit)')##This gives the user a chance to quit
  20. sign = input()##sign is assigned the value given by the user
  21. if sign == '':##if they press retun with a blank it ends
  22. break
  23.  
  24. if sign in zodiac:##Checks to see if sign in dictionary data, I did not add a way to add a key because there are no more zodiac signs.
  25. print(zodiac[sign])##this prints the information for the user zodiac
  26. else:
  27. print('I do not have information for ' + sign)##error message
  28. print('Thank you I hope you enjoyed the information!')##goodbye message to the user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement