Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,894 questions

51,825 answers

573 users

How to get the zodiac sign for a given day and month of birth in Python

1 Answer

0 votes
def print_zodiac_sign(m, d):
    if (m == 12 and d >= 22) or (m == 1 and d <= 19):
        print("Your Zodiac Sign is: Capricorn")
    elif (m == 1 and d >= 20) or (m == 2 and d <= 18):
        print("Your Zodiac Sign is: Aquarius")
    elif (m == 2 and d >= 19) or (m == 3 and d <= 20):
        print("Your Zodiac Sign is: Pisces")
    elif (m == 3 and d >= 21) or (m == 4 and d <= 19):
        print("Your Zodiac Sign is: Aries")
    elif (m == 4 and d >= 20) or (m == 5 and d <= 20):
        print("Your Zodiac Sign is: Taurus")
    elif (m == 5 and d >= 21) or (m == 6 and d <= 20):
        print("Your Zodiac Sign is: Gemini")
    elif (m == 6 and d >= 21) or (m == 7 and d <= 22):
        print("Your Zodiac Sign is: Cancer")
    elif (m == 7 and d >= 23) or (m == 8 and d <= 22):
        print("Your Zodiac Sign is: Leo")
    elif (m == 8 and d >= 23) or (m == 9 and d <= 22):
        print("Your Zodiac Sign is: Virgo")
    elif (m == 9 and d >= 23) or (m == 10 and d <= 22):
        print("Your Zodiac Sign is: Libra")
    elif (m == 10 and d >= 23) or (m == 11 and d <= 21):
        print("Your Zodiac Sign is: Scorpio")
    elif (m == 11 and d >= 22) or (m == 12 and d <= 21):
        print("Your Zodiac Sign is: Sagittarius")

m = 2
d = 27

print_zodiac_sign(m, d)

  
  
'''
run:
  
Your Zodiac Sign is: Pisces
  
'''

 



answered Jan 5, 2025 by avibootz

Related questions

...