11 Tips And Tricks in Python To Write you Code Better
10 months ago
15
All Tips:
1) Iterate with enumerate instead or range(len(x))
2) Use list comprehension instead of raw for loops
3) Sort complex iterables with sorted()
4) Store unique values with Sets
5) Save memory with Generators
6) Define default values in Dictionaries with .get() and .setdefault()
7) Count hashable objects with collections.Counter
8) Format strings with f-Strings (Python 3.6+)
9) Concatenate strings with .join()
10) Merge dictionaries with {**d1, **d2} (Python 3.5+)
11) Simplify if-statements with if x in list
Loading 1 comment...
-
35:04
Power Slap
7 days agoPower Slap: Road to the Title - Season 3 Episode 9 - Bring Out That Monster
858K122 -
15:52
Scammer Payback
1 month agoScammers Located in this Apartment
201K72 -
10:41
Breaking Points
3 days agoARSON, 'FREAK OFFS', LUBE: Diddy Indictment SHOCKING DETAILS
186K72 -
45:44
hickok45
23 hours agoSunday Shoot-a-Round # 247
130K79 -
3:34
Cooking with Gruel
1 day agoBrown Butter Deviled Eggs
111K19 -
11:06
Bearing
20 hours agoThe Office 2024 Australian Reboot Looks GARBAGE
92.9K38 -
28:21
Lloyd And Mandy
1 day ago $4.56 earnedThe INCREDIBLE Hack Every Online Business Owner MUST KNOW In 2024..
90.9K19 -
0:51
scoutthedoggie
1 day agoWhat's in your Northeast UZI Rob?
73.2K4 -
12:49
Misha Petrov
1 day agoI Triggered The Furries…
94.2K83 -
6:22:05
Akademiks
1 day agoNicki Minaj EXPOSES Jay Z over Finessing HER! Diddy got all his Peers Hiring Lawyers & on the RUN!
184K114