I am a beginner in Python and I am trying to write a program that is essentially a "fortune teller" using functions. I seem to be having an issue when calling a function get_today() which is written to take an input form the user for the day of the month, and return it as an integer.
However when I call on the function I am prompted with an error that goes:
TypeError: get_today() missing 1 required positional argument: 'd'
I've tried playing around a bit and cannot figure out what this means. Here is the main function:
def main():
print("Welcome to Madame Maxine's Fortune Palace. Here, we gaze deeply into your soul and find the secrets that only destiny has heretofore known!")
print("")
print("The power of my inner eye clouds my ability to keep track of mundane things like the date.")
d = get_today()
print("Numerology is vitally important to fortune telling.")
b = get_birthday()
if(d >=1 and d <= 9):
print("One more question before we begin.")
a = likes_spicy_food()
print("I will now read your lifeline")
read_lifeline(d,b,a)
if(d >= 10 and d <= 19):
print("I will now read your heartline.")
read_heartline(d,b)
if(d >= 20 and d <= 29):
print("I need one last piece of information.")
m = get_birthmonth()
read_headline(b,m)
if(d == 30 or d == 31):
print("Today is a bad day for fortune telling.")
print("These insights into your future are not to be enjoyed or dreaded, they simply come to pass.")
print("Good day.")
main()
This issue will likely repeat when the second function get_birthday() is called, which asks the user for the day of the month they were born.
Here is the code snippet for get_today():
def get_today():
x = int(input("Tell me, what day of the month is it today:"))
return x
Help would be massively appreciated!
get_todaytakes an argument but when you all it inmain, you don't give it any arguments. It looks like you don't actually need the argument forget_today, so remove thedindef get_today(d):get_todayyou're not passing an argument to it for a start...TypeError: get_today() missing 1 required positional argument: 'd'