What is One Line & Multi Line Docstring in Python | EP-47 Docstring in Python Part 2 | Python Videos

Subscribers:
28,000
Published on ● Video Link: https://www.youtube.com/watch?v=6Qff_rfpaxo



Duration: 0:00
34 views
0


4. One-line Docstrings
""" As the name suggests, one-line docstrings fit in one line.
They are used in obvious cases. The closing quotes are on the same line as the opening quotes. This looks better for one-liners."""
def power(a,b):
' ' 'Returns arg1 raised to power arg2.' ' '
print(a**b)
return a**b
print(power.__doc__)
power(5,6)

5. Multi-line Docstrings
""" Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line maybe on the same line as the opening quotes or on the next line."""

def add_numbers(a,b):
"""
This function takes two numbers as input and returns their sum.

Parameters:
a (int): The first number.
b (int): The second number.

Returns:
int: The sum of a and b.
"""
return a+b
print(add_numbers(3,5))
print(add_numbers.__doc__)

#PythonTutorial #DocstringsInPython #PythonForBeginners #PythonCode #CodingTips #OneLineDocstring #MultiLineDocstring #LearnPython #PythonVideos #CodeDocumentation #PythonProgramming #Python #Docstrings #Programming #Tutorial #Coding #PythonTips #SoftwareDevelopment #Developer

Connect With Us:
—————————————
➡ ️ Websitehttps://www.cybrosys.com/m/
➡ ️ Email: info@cybrosys.com
➡ ️ Twihttps://twitter.com/cybrosysosys  
➡ ️ Lihttps://www.linkedin.com/company/cybrosys/brosys  
➡ ️ https://www.facebook.com/cybrosystechnologiesnologies  
➡ ️ https://www.instagram.com/cybrosystech/brosystech  
https://pinterest.com/cybrosys/  / cybrosys  




Other Videos By Cybrosys Technologies


2024-10-14How to Configure Proforma Invoice in Odoo 18 Sales | Odoo 18 New Features | Odoo 18 Sales | Odoo 18
2024-10-13Save for Later Feature in Odoo 18 Website | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18
2024-10-13What is Anonymous Function in Python | EP-49 Anonymous Functions in Python | Python Lambda Functions
2024-10-13Product Ribbons for Variants in Odoo 18 Website | Odoo 18 New Features | Odoo 18 Release Date
2024-10-11What is the Overview of Attendance Management System Features in Horilla HRMS? | Free HR Software
2024-10-10How to Manage Catalog View in Invoice & Bill in Odoo 18 | Odoo 18 Accounting | Odoo 18 New Features
2024-10-10How to Copy a Message Link in Chatter in Odoo 18 | Odoo 18 New Features | Odoo 18 Release Date
2024-10-09What is Nested Function in Python | EP-48 Nested Function | Function within Function | Python Videos
2024-10-09How to Import Images in Odoo 18 | Import Product Images in Odoo 18 | Odoo 18 New Features | Odoo 18
2024-10-09How to Manage Empty Location in Odoo 18 Inventory | How to Filter Zero Stock in Odoo 18 | Odoo 18
2024-10-08What is One Line & Multi Line Docstring in Python | EP-47 Docstring in Python Part 2 | Python Videos
2024-10-07What is Bidirectional Replication (BDR) in Odoo | R&D Sneak Peek | BDR
2024-10-07Revamp in Odoo 18 Document | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18 Document App
2024-10-07How to Configure Multiple Approvals for Leave Requests in Horilla HRMS | Free HR Software| Best HRMS
2024-10-07How to Publish Job Position on Third-Party Job Board in Odoo 18 Recruitment | Odoo 18 New Features
2024-10-06Drag & Drop Attachments for Importing in Odoo 18 | Odoo 18 New Features | Odoo 18 Release Date
2024-10-06What is a Docstring in Python | EP-46 Docstring in Python | How to Use Docstrings in Python | Python
2024-10-06How to Request Documents/Files From Employees in Horilla HRMS | Best Open Source HRMS Software
2024-10-04Revamp in Odoo 18 Debug | Odoo 18 New Features | Odoo 18 Release Date | Odoo 18 Debug Mode
2024-10-04What is Bi-Directional Replication (BDR) in Odoo | How BDR Can Revolutionize Your Odoo Deployments
2024-10-03How to Install Odoo 18 with Pycharm | Setup Odoo 18 Development Environment Using Pycharm in Ubuntu