🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 2 Min Lesezeit
0

day -8 at payilagam import and modules

↗ Quelle (dev.to)
🗣️ Stimme:

MODULE:



A Python module is a file containing Python definitions and statements. A module can define functions, classes, and variables. A module can also include runnable code.



python module ends with .py



name: gives module name

file: gives file path

doc : tells documentation string



identifiers starting and ending with double underscores (like name, doc, etc.) are called "dunder" (double underscore) methods or attributes.




CODE
print("Hello")
print(__name__)






the value of name will be set to "main".




CODE

print("Hello")
print(__file__)

output:
Hello
__main__






the script which is saved as first file and you run it directly with python first file, the output will look something like this:



Hello

/home/raja/Desktop/first.py



''' User module documentation string'''

print(doc)



User module documentation string





calculator.py





CODE

def add(no1,no2):
print(no1+no2)

def subtract(no1,no2):
print(no1-no2)

def multiply(no1,no2):
print(no1*no2)

def divide(no1,no2):
print(no1/no2)





The import statement in Python is used to bring code from one module (a Python file) into another.





user.py



import calculator



calculator.add(100,123)

calculator.multiply(10,3)



This will call the add function from your calculator module, which adds 100 and 123.

This will call the multiply function, which multiplies 10 and 3.



223

30





user.py





CODE
from calculator import add, divide

add(100,200)
divide(200,40)

300
5.0





help()



In Python, the help() function is a built-in function used to display documentation about Python objects, modules, functions, classes, or methods.




CODE
import math
help(math)






This will display detailed information about the math module, including its functions like floor(), ceil(), etc.




CODE
help('modules')






This will displays the list of modules available in python.



task:




CODE
money.py
def deposit:
def deposit(amount):
print("Enter the deposit amount:",amount)
def withdraw(amount):
print("Enter the withdraw amount:",amount)

consumer.py
import money
money.deposit(1000)
money.withdraw(500)


Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten day -8 at payilagam import and modules

Thematisch verwandte Begriffe: payilagam, import, modules · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...