Python Forum
Functions & Passing Parameters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions & Passing Parameters
#1
Hi

Just started to learn coding so I hope this is an easy question for someone else to help with :)

I've written the code below and expect it to return a value to show the value of the bike reducing until it reaches less than 1000. Clearly I am missing something here as it's returning a weird error message that I can't find anything about on Google.

Appreciate any advice to help a newbie out :)
def function_1(bike_value):
    bike_value = 2000
​
    while bike_value > 1000:
        print("£",bike_value)
        bike_value * 0.9
    
    output = print(bike_value)
    
    return output
​
message = function_1
print(message)
Output:
<function function_1 at 0x000000F9C85F2550>
Larz60+ write Jan-17-2021, 04:30 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Reply


Messages In This Thread
Functions & Passing Parameters - by KAShears79 - Jan-17-2021, 04:22 PM
RE: Functions & Passing Parameters - by ndc85430 - Jan-17-2021, 05:05 PM
RE: Functions & Passing Parameters - by deanhystad - Jan-17-2021, 05:07 PM
RE: Functions & Passing Parameters - by jefsummers - Jan-17-2021, 08:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions with parameters slehee 2 3,904 Oct-20-2017, 07:47 PM
Last Post: slehee

Forum Jump:

User Panel Messages

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