Whats the difference


#1

Please leave the following link in the post so we can find the unit module, else replace it with a link to the exact lesson:

can anyone please explain to me the difference between a function where you call after an argument with a decimal
e.g. argument.upper()
and a function where you put the argument within the parenthesis
e.g. str(argument)

Strings and Console Output


#2
[].append(1)

That asks the list to append 1, append is a method that the list itself provides, methods are the behaviour of a value.

Functions tend to operate on more than just one type of value, or might not be something that the type itself is doing. For example, some functions operate on anything that is iterable, that could be a list, a tuple, a dictionary, a generator, a queue, …

Any method could be a function instead, and likewise, any function could be a method. There are languages that only have one or the other.


#5

At first instance I thought that you were asking for both python and js, therefore I replied for js.
I am not sure regarding python but it may also be like js.
I am going to ask this on stackoverflow.


#6

Check this


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.