Q:

Getting an error when attempting to call a function

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! 

A:

When I run this code as is, it doesn't give me your error. However, when I run this code with d = get_today() as d = get_today(d) under main, I get the error you're getting.
When you call a function, what goes between the parentheses is what gets passed into the function. Since you don't have d assigned yet, you can't pass it in. In addition, your function doesn't need variables to be passed in since all it is is the user input.
Try this:
def main():
    #code
    d = get_today()
    #more code

def get_today()
    #the function with return statement

main()

