Python3 Write a program with following functions: get_today, get_birthmonth,like
ID: 3588525 • Letter: P
Question
Python3
Write a program with following functions: get_today, get_birthmonth,likes_spicy_food, read_lifeline, read_heartline,read_headline. the output should as same as example
The explaination of each functions:
Your program must include the following functions: get today: this function should prompt the user for what date it is today and return it as an nt. . » get birthday: this function should prompt the user for the day of the month that they were born on and return it as an int. get birthmonth: this function should prompt the user for the the month that they were born in and return it as an int. likes_spicy_food: this function should prompt the user about whether or not they like spicy food and return a boolean value. True if the user likes spicy food, False otherwise.Explanation / Answer
def get_birthday():
birthday =int(input("Tell me, what day of the month were you born on: "))
return birthday
def get_today():
dayMonth = int(input('Tell me, what day of the month is it today: '))
return dayMonth
def get_birthmonth():
birthmonth = int(input("I need one last piece of information. Tell me, what month were you born in: "))
return birthmonth
def likes_spicy_food():
print("One more question before we begin ..")
choice = int(input("Do you like spicy food? (1 = yes, 2 = no) "))
if choice == 1 :
return True
if choice == 2 :
return False
def read_lifeline(date, birthdayDate, spicyFood):
print('I will now read your lifeline.')
if spicyFood is True and birthdayDate%3==0:
print ("You have a long, deep line. Your life will be filled with health and balance.")
elif spicyFood is True and date%4==0 or date%5==0:
print("You have a short, deep line. You possess remarkable fortitude.")
elif spicyFood is True and birthdayDate%3 !=0 and date%4 !=0 and date%5 !=0 :
print("A dark cloud passes over my inner eye.")
elif spicyFood is False :
print("Your line is forked and branching. Interesting events await you.")
def read_heartline(date, userBirthday):
print('I will now read your heartline.')
heartlineData = (date - userBirthday)
if heartlineData == 0:
print('Your heartline is the perfect example of long. You are filled with warmth and love.')
elif abs(heartlineData) > 10 :
print("You have a faint line. You will need to work to stay present emotionally.")
else :
print("The deepness of your heartline will cause trouble if you are not aware.")
def read_headline(userBirthdayDay,birth_month):
print('I will now read your headline')
if userBirthdayDay == 15 and birth_month == 3:
print("I'm afraid the crosses that I see here cannot be good.")
elif userBirthdayDay == birth_month :
print("The deep and wavy line here shows excellent memory but not without conflict.")
elif userBirthdayDay%2 ==0 and birth_month%2 ==0 or userBirthdayDay%2 !=0 and birth_month%2 !=0:
print("The branched and upwards line here shows big dreams and self awareness.")
else:
print("The branched line here shows many events unknown to even the spirits.")
def printWelcomeMessage():
print("Welcome to Madame Maxine's Fortune Palace.")
print("Here, we gaze deeply into your soul and find the secrets that only destiny has heretofore known!")
def sayBye():
print()
print("These insights into your future are not to be enjoyed or dreaded, they simply come to pass.")
print("Good day.")
def printBadDay():
print()
print("Today is a bad day for fortune telling.")
def printFirstLine():
print("The power of my inner eye clouds my ability to keep track of mundane things like the date.")
def printThirdLine():
print("Numerology is vitally important to fortune telling.")
def main():
printWelcomeMessage()
print()
printFirstLine()
todayDate = get_today()
printThirdLine()
userBirthdayDay= get_birthday()
if 0<todayDate<=9 :
spicyFood= likes_spicy_food()
read_lifeline(todayDate,userBirthdayDay,spicyFood)
if 9<todayDate<=19 :
read_heartline(todayDate,userBirthdayDay)
if 19<todayDate<=29 :
birth_month = get_birthmonth()
read_headline(userBirthdayDay,birth_month)
if todayDate == 30 or todayDate == 31:
printBadDay()
sayBye()
main()
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.