Python Forum
A Problem With The Body of My Function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Problem With The Body of My Function
#2
Working from your code, the def volume(cargo) statement needs a colon at the end.
Can't tell if your indentation is correct, please repost using proper tags. Indentation is critical.
total_net_load = x Where does the interpreter get the value for x?
Next line - It appears you do not understand assignment statements. The = means it is an assignment. They are in the format
<variable> = <expression>, not the other way around.
No idea what you are trying to do with the return statement. That needs to be in the format return <expression> where <expression> resolves to a variable.

Note that in Python variables are objects, so you can substitute the word object in any of the above.
Reply


Messages In This Thread
RE: A Problem With The Body of My Function - by jefsummers - Jul-01-2020, 05:40 PM

Forum Jump:

User Panel Messages

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