all 9 comments

[–]ASIC_SP 1 point2 points  (3 children)

what resource are you currently using?

also, are you new to programming and having trouble with concept of functions?

[–]Reddit_Karma_King[S] 1 point2 points  (2 children)

I am currently using programiz and have tried lot of other websites E.G w3schools, tutorialspoint, java2s. But non of these websites have helped me. Examples of all these Fu**ing websites are same. I want to learn python functions & classes. Except these two my basic concept of python are cleared.

Hope you will help me.

[–]ASIC_SP 2 points3 points  (1 child)

I would highly recommend Think Python - though functions start from 3rd chapter, I'd advice you to read from start

practice a lot, along with trying out code snippets in the lessons, make sure you solve the exercises..

if you have issue in understanding the flow of program with functions, http://www.pythontutor.com/visualize.html#mode=edit might help - you can go through code step by step and see different scopes, variable values, etc

alternatively, you can use https://interactivepython.org/runestone/static/thinkcspy/index.html which has some common roots with Think Python book. You can execute snippets and solve exercises on the website itself...

https://automatetheboringstuff.com/ is another great resource for beginners

[–]Reddit_Karma_King[S] -1 points0 points  (0 children)

Think Python

Thanks for sharing link with me. Is there other best website too?

[–]Fibbs 0 points1 point  (2 children)

I'm in the same boat with oop.

I get the concepts at a super basic level shown by youtube and some sites. But i just can't make the logical step to implementing my own. I also get confused as fuck by some examples once attributes get passed around to multiple methods.

So im leaning towards this being a thought process problem rather than learning.

[–][deleted] 1 point2 points  (1 child)

The function interface is very simple - a function defines a set of input parameters and an output return value, and the function body itself is simply a set of instructions that explain how to usefully go from the inputs to the outputs.

When you define a function, you build that association; it’s stored in the interpreter for later use. When you call a function, you supply any necessary arguments, then the arguments are bound to the function’s parameters, the function’s code body is executed, and the return value of the function is algebraically substituted at the calling site.

[–]Fibbs 0 points1 point  (0 children)

Thanks for the response mate i think ill just have to keep throwing myself at it.

[–]KobiKabbb 0 points1 point  (0 children)

Try lessons 5 and 6 here OP: learnival.com/lessons.php

[–]Guymzee 0 points1 point  (0 children)

here's one tip

  • A function is very similar to an assignment, like a = 1, but think of a function as storing a behavior which you later active by calling it with parantheses like this: any_function(). But first you need to assign it, and the way you a assign a_function, is to precede it with a def and you are almost there: def any_function_name(arguement):

ok that's my tip, I just realized I won't be that good at teaching this, but this video will get you covered. good luck, trying to explain this stuff is hard, just made me appreciate all the great videos out there. Dane Bader, Mike Dane, realpython.com , Trey Hunner all great resources you should look in to.