Error in a script, but where?

hello,

def monthly_salary(annual_salary):
    return annual_salary / 12

def weekly_salary(monthly_salary):
    return monthly_salary / 4

def hourly_wage(weekly_salary, hours_worked):
    return weekly_salary / hours_worked

annual_salary = float(input("annnual_salary : "))
hours_worked = float(input("hours_worked : "))


monthly = monthly_salary(annual_salary)
print(monthly)
print("type monthly: ", type(monthly))
weekly = weekly_salary(monthly_salary)
print(weekly)
~$ /bin/python3 /home/mmas/pyth.py
annnual_salary : 33699
hours_worked : 35
2808.25
type monthly:  <class 'float'>
Traceback (most recent call last):
  File "/home/mmas/pyth.py", line 17, in <module>
    weekly = weekly_salary(monthly_salary)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mmas/pyth.py", line 5, in weekly_salary
    return monthly_salary / 4
           ~~~~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for /: 'function' and 'int'

I don’t understand why I can have both [type monthly: <class ‘float’>] and [File “/home/mmas/pyth.py”, line 5, in weekly_salary
return monthly_salary / 4
~~~~~~~~~~~~~^
TypeError: unsupported operand type(s) for /: ‘function’ and ‘int’]

that seems to indicate that “monthly” is either a function or an integer ‘int’?

Wrong here:

weekly = weekly_salary(monthly_salary)

However, you defined “monthly_salary” as a function, in weekly_salary, monthly_salary / 4 means the function devided by 4, which is impossible.

Maybe:

weekly = weekly_salary(monthly)

Using the name which has been defined externally as the parameter’s name in the function is not a good idea. Change the habit.

Now that the error has been identified, I need to think about it to fully understand your answers.

Thank you very much.