YouTube Excerpt: π Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you Learn Python from A to Z! π₯οΈ Documenting your Code in Python: Docstring in Python Although optional, documentation is a good programming practice - especially if you want to get your dreamed job at Google, Apple, Facebook or anywhere in the World! Plus, unless you can remember what you had for dinner last week, always documenting your code will help you a lot when you will need to stay away for a while, then come back. You can attach documentation in Python to a function definition by including a string literal called docstring, just after the function header. It is briefly used to explain what a function does. β What is a Docstring in Python? A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. Such a docstring becomes the __doc__ special attribute of that object. Note: Docstrings in Python are usually triple quoted, to allow for multi-line descriptions. β Documenting your Code in Python: Docstrings in Python def hello(): """This function prints message on the screen""" print('Hello, World!') β Print Function Help (Rich format) To print a functionβs documentation, use the Python help() function and pass the functionβs name as parameter. help(hello) # Help on function hello in module __main__: # hello() # This function prints # message on the screen β Print Function Help (RAW format) You can also access the docstring in Python through __doc__ attribute of the function. print(hello.__doc__) # OUTPUT: This function prints message on the screen Let's play this video, stick around and watch until the end of this video! ππ» - Digital Academyβ’ π *** β WATCH NEXT: β Data Types in Python - https://youtu.be/cweUByxBWiU β Operators in Python - https://youtu.be/-wDaVLkKOiU β IF Statements in Python - https://youtu.be/CC5seZ6OBJ4 β FOR Loops in Python - https://youtu.be/JgH-D5DSTho π Blog: http://digital.academy.free.fr/blog π [FULL Course] HOW TO Learn Python? Python Tutorial for Beginners: https://youtu.be/9hvnSZPMtuw π [PLAYLIST] Complete Python Development Course for Beginners: http://digital.academy.free.fr/playlist/python-development-for-beginners π§βπ [COURSE] http://digital.academy.free.fr/courses π [BOOK] Python for Absolute Beginners: https://amzn.to/3NvyOWV π Shopping and Discounts: http://digital.academy.free.fr/store π Weekly Newsletter for Developers: https://www.getrevue.co/profile/digital_academy #Python #Tutorial #Beginners #Shorts *** β‘ Thanks for watching and supporting β‘ Please Subscribe. Hit the notification bell. Like, Comment and Share. *** β‘ FOLLOW US β‘ β§ http://digital.academy.free.fr/ β§ https://twitter.com/DigitalAcademyy β§ https://www.facebook.com/digitalacademyfr β§ https://www.instagram.com/digital_academy_fr/ β§ https://www.youtube.com/c/DigitalAcademyOnline β‘ SUPPORT US β‘ β§ http://digital.academy.free.fr/join β§ http://digital.academy.free.fr/store β§ http://digital.academy.free.fr/donate β§ http://digital.academy.free.fr/subscribe β§ https://www.patreon.com/digital_academy β§ https://www.buymeacoffee.com/digital_academy ***
π Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you Learn Python from A to Z! π₯οΈ...
Curious about Documenting A Function In Python: DOCSTRING In Python - Python Tutorial For Beginners's Color? Explore detailed estimates, salary breakdowns, and financial insights that reveal the full picture of their profile.
color style guide
Source ID: XPK6R19igs8
Category: color style guide
View Color Profile π
Disclaimer: %niche_term% estimates are based on publicly available data, media reports, and financial analysis. Actual numbers may vary.
Sponsored
Sponsored
Sponsored