lokeshjoshi
Profilo di
Nome | lokeshjoshi |
---|---|
Indirizzo email | n/a |
Messaggi | 1 |
-
- 2023-03-22 13:30:00
- Re: Creazione Programma Python
- Forum >> Programmazione Python >> Web e Reti
- Here's a simple Python program that takes the day and month of birth as input and prints the corresponding zodiac sign as output:
# Get input from user
day = int(input("Enter your day of birth: "))
month = int(input("Enter your month of birth: "))
# Check for each zodiac sign
if month == 1: # January
if day <= 19:
print("Capricorn")
else:
print("Aquarius")
elif month == 2: # February
if day <= 18:
print("Aquarius")
else:
print("Pisces")
elif month == 3: # March
if day <= 20:
print("Pisces")
else:
print("Aries")
elif month == 4: # April
if day <= 19:
print("Aries")
else:
print("Taurus")
elif month == 5: # May
if day <= 20:
print("Taurus")
else:
print("Gemini")
elif month == 6: # June
if day <= 20:
print("Gemini")
else:
print("Cancer")
elif month == 7: # July
if day <= 22:
print("Cancer")
else:
print("Leo")
elif month == 8: # August
if day <= 22:
print("Leo")
else:
print("Virgo")
elif month == 9: # September
if day <= 22:
print("Virgo")
else:
print("Libra")
elif month == 10: # October
if day <= 22:
print("Libra")
else:
print("Scorpio")
elif month == 11: # November
if day <= 21:
print("Scorpio")
else:
print("Sagittarius")
elif month == 12: # December
if day <= 21:
print("Sagittarius")
else:
print("Capricorn")
else:
print("Invalid month")
Hope this will help you