Everything wrong with python in two lines
example = 'fuck'.upper
print(example)
>>>
print(example.upper())
>>>'FUCK'
Everything wrong with python in two lines
wtf is this shit real?
>this somehow became one of the most popular languages
Upper is a method you tard, line one was essentially you just stating a function pointer.
Why are all the threads criticizing popular programming languages populated with people who clearly can't program or read the docs?
It shows how bad you are to:
- Read a doc
- Use a function
- Understanding messages on the screen
- And so on...
much easy
very intuitive
wow
This is also retarded though because you can do things like this
x = str.upper
map(x, list_of_strs)
In this case the function magically applies as you would expect. Example in OP should just be a function pointer to the upper function, not the upper function applied to a defined string.
Now following along tell me what should happen in the following example:
example = 'fuck'.upper
print(example)
>>>
list_of_strs = ['a', 'b', 'c']
print( list(map(example, list_of_strs)) )
It's not intuitive, it's documented. Stop expecting shit to spoonfeed you you fucking brainlet mongoloid
I thought you had a point, but turns out you are just retarded.
>>> example = 'fuck'.upper
>>> print(example)
>>> print(example.upper())
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'builtin_function_or_method' object has no attribute 'upper'
>>>
I'm not surprised some dickhead learning python cannot into function pointers.
obviously just a typo. It should be example().
Go rage over at faggot
>too much of a brainlet to know the difference between a reference to a function and the result of calling a function
>somehow this is python's fault