3 Quick Python Tricks You MUST Know! #Shorts

preview_player
Показать описание
Another youtube #shorts video!

Python trick one: swapping 2 numbers in place
Python trick two: reversing a string
Python trick three: finding the most frequent element in a list

Рекомендации по теме
Комментарии
Автор

Don‘t call your list variable list. Same applies to other reserved words.

WowikFD
Автор

Please don't call you strings str and your lists list, that's already the name of the type.

lwi_sandwich
Автор

You could use Counter from the collections module as well

christianrubio
Автор

count for list object doesnot apply to a int object

souravkarmakar
Автор

You can, but must never use list as name of your list, str as name of your string and so on...

because first when I looked at your most frequent finding statement, I wondered for long how tf could that work because statement had 'list' written without '( )', then I saw that list was not a function, but name...

odio_stationofficial
Автор

Last Task:
TypeError: descriptor 'count' for 'list' objects doesn't apply to a 'int' object...

Did you even run the code you published???

newslap_
Автор

big tip. Do one trick and spend more time on it and explaining also use better font with contrast and not so large.
big up ❤

originalbinaryhustler
Автор

first one's not just for numbers
for the last two please don't name your variables str or list as they're built in types

qwerty_qwerty
Автор

Lol dont call your lists list just call it lst or a placeholder _

Idonoteatdogs
Автор

bro how you donwload this your python interface is so weird and my is diffrent

aungamer