6 CLEAN Tips To IMPROVE Your Python Functions

preview_player
Показать описание
Here are 6 clean tips that you can use for improving the readability & the practicality of your functions in Python.

▶ Become job-ready with Python:

▶ Follow me on Instagram:
Рекомендации по теме
Комментарии
Автор

Another tip i would recommend, is do not be afraid to have function names a bit longer if it is more self-explanatory
(for example, a function sorting a list a certain specific way should not be called something like "sort_list()" or "custom_sort()", give a hint of how it sorts the list exactly, like "sort_by_descending_order()")

dragweb
Автор

Wow, I didn't even know I could specify return type and parameter type in python! I used to think that my python code looked super messy and potentially unpredictable compared to other languages. I'll definitely be making use of this!

jakedeschamps
Автор

Great job on the video, it was well put together and Thorough. I like how you use functions that have real world application instead of useless functionality. Also how it has real functionality how multiple functions interact with each other. Great job!

fernandomassey
Автор

thank you so much. Your chanel helps me a lot to improve my learning of python. Good practices, tips etc. So this morning, I changed my code to add these good practices ;) Very nice these little videos on specifics points. Congrats

davidl
Автор

I love how in the pre-type-hint-era, many Python devs were very smug about how amazing it is to not have to specify your types. Type Hints get added, and now they're all figuring out that being somewhat strict about what types you pass around actually makes sense.

It's almost as if being strict while writing makes things much easier when reading.

MechMK
Автор

Excellent advice. Thank you for sharing.

fredflintstone
Автор

Use match statements with walrus... Deadly combo for beautification of this code

SP-dbsh
Автор

I've been binging your videos lol they're so great. If you haven't already, I'd love to see you make a video about generators and the "yield" keyword. I really don't understand it but I'm sure you could explain it well :)

ashersaipe
Автор

Man, you are awesome I loved this video I would like to watch more of these.

ShivaniSingh-cevb
Автор

Good stuff! I still make that #4 mistake quite often in my python apps and pay for it later with code refactors haha

WhyNotProgram
Автор

Where can i get that white python hoodie?

RobinZuFALL
Автор

If only the world could write code as beautifully as this.😇

legrndk
Автор

Can you do a tutorial on how to properly write function/module documentations? Thanks!!!

judithlee
Автор

@3:40: you added type hints as float for *numbers parameter and the return type but the result was in int. Could you please explain?

fullstackspiderman
Автор

Some great tips, thanks ☺. Is there a pythonic reason for all lower case function names with an under in between words? I personally don't like the underscore in function names and prefer PascalCase (uppercased first letter of each word in the function name) for names, they stand out more.

castlecodersltd
Автор

Very nice I didn't know that's what a doc string is for

hlubradio
Автор

6:02 SICK ! that is what i was looking for long time ! n1 thank you !

yeahnick
Автор

hi. for function return notation (point 1) why not just look at the return statement or add a comment to have notation of return type? are there any other advantages to this style of notation that make up for (visually) turning code into garbally gouk?

fluffykitties
Автор

Hi, I am using vs code and when I type hint my return type some of my keywords turn white. I am using vs code. Can anyone help me out here?

jonathanlloyd
Автор

Hi, nice YouTube channel. I have one question:
3:24 - why didn't the interpreter yell about returning integers, when you have "-> float" next to the function?

littledonkey