Question

use python Write a program that asks the user for day and month of a birthday....

use python

Write a program that asks the user for day and month of a birthday. The program then tells the Zodiac signs that will be compatible with that birthday.

#Example for Aries The Ram    Mar. 21–Apr. 19

day = 24 # user enters

this month = 3 # user enters this

if ( month == 3 and day >=21) or (month == 4 and day <= 19):

print("You are Aries, Fire group, compatible with Aries, Leo, Sagittarius")

Zodiac Signs:

Constellation    English Name Dates

-Aries    The Ram Mar. 21–Apr. 19

-Taurus    The Bull    Apr. 20–May 20

-Gemini    The Twins May 21–June 21

-Cancer    The Crab June 22–July 22

-Leo The Lion July 23–Aug. 22

-Virgo    The Virgin Aug. 23–Sept. 22

-Libra    The Balance Sept. 23–Oct. 23

-Scorpio    The Scorpion Oct. 24–Nov. 21

-Sagittarius    The Archer    Nov. 22–Dec. 21

-Capricorn The Goat    Dec. 22–Jan. 19

-Aquarius    The Water Bearer    Jan. 20–Feb. 18

-Pisces    The Fishes Feb. 19–Mar. 20

Compatible Zodiac signs:

- Fire    (Aries, Leo, Sagittarius)

- Earth (Taurus, Virgo, Capricorn)

- Air (Gemini, Libra, Aquarius)

- Water    (Cancer, Scorpio, Pisces)

SAMPLE RUN:

Please enter day of birth: 18

Please enter month of birth: 5

A birthday of 05 / 18 had the zodiac "Taurus"

Taurus is compatible with: Taurus, Virgo, Capricorn.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new python program with name "main.py" is created, which contains following code.

main.py :

#asking user birth day
day=int(input("Please enter day of birth: "))
#asking user month of birth
month=int(input("Please enter month of birth: "))
if((month==3 and day >=21) or (month==4 and day<= 19)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Aries")
print("Aries is compatible with :Aries,Leo, Sagittarius")
elif((month==4 and day >=20) or (month==5 and day<= 20)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Taurus")
print("Taurus is compatible with :Taurus,Virgo, Capricorn")
elif((month==5 and day >=21) or (month==6 and day<= 21)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Gemini")
print("Gemini is compatible with :Gemini, Libra, Aquarius")
elif((month==6 and day >=22) or (month==7 and day<= 22)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Cancer")
print("Cancer is compatible with :Cancer, Scorpio, Pisces")
elif((month==7 and day >=23) or (month==8 and day<= 22)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Leo")
print("Leo is compatible with :Aries, Leo, Sagittarius")
elif((month==8 and day >=23) or (month==9 and day<= 22)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Virgo")
print("Virgo is compatible with :Taurus, Virgo, Capricorn")
elif((month==9 and day >=23) or (month==10 and day<= 23)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Libra")
print("Libra is compatible with :Gemini, Libra, Aquarius")
elif((month==10 and day >=24) or (month==11 and day<= 21)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Scorpio")
print("Scorpio is compatible with :Cancer, Scorpio, Pisces")
elif((month==11 and day >=22) or (month==12 and day<= 21)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Sagittarius")
print("Sagittarius is compatible with :Aries, Leo, Sagittarius")
elif((month==12 and day >=22) or (month==1 and day<= 19)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Capricorn")
print("Capricorn is compatible with :Taurus, Virgo, Capricorn")
elif((month==1 and day >=20) or (month==2 and day<= 18)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Aquarius")
print("Aquarius is compatible with :Gemini, Libra, Aquarius")
elif((month==2 and day >=19) or (month==3 and day<= 20)):
print("A birthday of 0",str(month),"/",str(day)," had the zodiac Pisces")
print("Pisces is compatible with :Cancer, Scorpio, Pisces")

Screen for indentation :

main.py 1 #asking 2 day-int (input(Please enter 3 #asking user birth day day of birth: )) user month of birth month-int (in

======================================================

Output : Compile and run above program to get the screen as shown below

Screen 1 :Run 1

Please enter day of birth: 2 Please enter month of birth: 8 A birthday of o 8 2 had the zodiac Leo Leo is compatible with Ari

Screen 1 :Run 2

Please enter day of birth: 18 Please enter month of birth: 5 A birthday of 0 5 18 had the zodiac Taurus Taurus is compatible

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
use python Write a program that asks the user for day and month of a birthday....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Programming Help: Horoscope Signs and Elements

    x.øi5="lblDescription">Write an astrology program. The user types ina birthday, and the program responds with the sign and horoscope forthat birthday. The month maybe entered as a number from 1 to 12. Thenenhance your program so that if the birthday is only one or two daysaway from an adjacent sign, the program announces that thebirthday ison a "cusp" and also outputs the horoscope for that nearest adjacentsign. This program will have a long multiway branch. Make up ahoroscope for each sign.Your...

  • Hello, I am wondering what the source code for this problem would be. Thank you so...

    Hello, I am wondering what the source code for this problem would be. Thank you so much. You will write a java program using the Eclipse IDE. The program will allow a user to perform one of two options. The user can look up the dates for a given zodiac sign or enter a date and find what sign corresponds to that date. SIGN START DATE END DATE Aries 3/21 4/19 Taurus 4/20 5/20 Gemini 5/21 6/20 Cancer 6/21 7/22...

  • QUESTION 6 There are 12 signs of the Zodiac: Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra,...

    QUESTION 6 There are 12 signs of the Zodiac: Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius, and Pisces. Each sign corresponds to a different calendar period of approximately 1 month. Assuming that a person is just as likely to be born under one sign as another, what is the probability that in a group of five people at least two of them were born under the sign of Aries? Da. 0.082 b.0.901 Dc. 0.205 d.0.059 e.0.515...

  • Python help it is a grade 12 course def find astrological sign(month, date): (int, int)-str Given...

    Python help it is a grade 12 course def find astrological sign(month, date): (int, int)-str Given two int values represent ing a month and a date, return a 3-character string that gives us what star sign a person born in that month and on that date belongs to, Use the SIGNS string (already defined for you at the top of this file) to figure this out. NOTE FROM BOB: A lot of string slicing to do here. It looks like...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT