Python Forum
why my function doesn't work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why my function doesn't work
#2
'tax' is the function itself, not the result of calling the function. What it is printing is not an error or warning, it is the repr of the function. To print the result, either print it directly (print(tax(2005, 100))), or store it in a variable and print the variable:

owed = tax(2005, 100)
print(owed)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
why my function doesn't work - by cimerio - Nov-19-2019, 06:51 PM
RE: why my function doesn't work - by ichabod801 - Nov-19-2019, 07:02 PM
RE: why my function doesn't work - by gontajones - Nov-19-2019, 07:09 PM
RE: why my function doesn't work - by cimerio - Jan-20-2020, 08:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extending list doesn't work as expected mmhmjanssen 2 364 May-09-2024, 05:39 PM
Last Post: Pedroski55
  print doesnt work in a function ony 2 461 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  Why doesn't calling a parent constructor work with arbitrary keyword arguments? PurposefulCoder 4 1,092 Jun-24-2023, 02:14 PM
Last Post: deanhystad
  Why doesn't this code work? What is wrong with path? Melcu54 7 2,087 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  color code doesn't work harryvl 1 1,035 Dec-29-2022, 08:59 PM
Last Post: deanhystad
  I dont know why my function won't work? MehHz2526 3 1,345 Nov-28-2022, 09:32 PM
Last Post: deanhystad
  client.get_all_tickers() Doesn't work gerald 2 1,870 Jun-16-2022, 07:59 AM
Last Post: gerald
  pip doesn't work after Python upgrade Pavel_47 10 4,577 May-30-2022, 03:31 PM
Last Post: bowlofred
  For Loop Works Fine But Append For Pandas Doesn't Work knight2000 2 2,190 Dec-18-2021, 02:38 AM
Last Post: knight2000
  Class Method to Calculate Age Doesn't Work gdbengo 1 1,839 Oct-30-2021, 11:20 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020