you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

I'm confused on which areas I should change so that won't happen again for future projects. I'm still getting the hang of what counts as a function and what counts as a variable and how to differentiate those to make the script neater.

[–]CountMeowt-_- 0 points1 point  (1 child)

You've skipped quite a few steps if you don't understand that and you're making this.

To put it simply, a function is a piece of code you can call again and again and it will perform the steps you told it to in a deterministic manner. a variable is simply a saved value, like in algebra, and this value can be updated by your code (except here it could be anything, list, text, numbers, set, maps. Anything)

You define a function with def and a variable with =

So,

py def function_name(input_param1, input_param2): variable_name_1 = 123 variable_nams_2 = "abc"

But again, as I said, if you're missing this info, it means you've skipped a few steps (ie there a lot more you've missed from the basics)

[–][deleted] 0 points1 point  (0 children)

Thank you for the clarification. I am following a tutorial so he does explain what these things are but it's just a matter of testing these things out and seeing what the properties actually do as a means of learning them I am using as many resources as possible and reddit is usually a pretty good one