Python Modules In Hindi

Python
Loading...

Python Modules In Hindi – Ham Is Post Me Dekhne Wale Hai, What is Modules ? and How to use Modules And Built-In Module In Hindi |

Python Modules In Hindi

Basically, Modules Hamare Python Ke Functions , Class And Statements Ko Contain Karta Hai , And Har Ek Module .py File Ke Sath Save Hota Hai |

Or Ham In Module Ko Kahi Bhi Or Kisi Bhi File Me Import And Include Kar Sakte Hai |

Python me Kuch inbuilt Modules Bhi Hote Hai, For Examples math, random Etc.. Python Me Modules Ye Ek Tarah Ka Program Hi Hota Hai And Modules Me Function Or Classes Hote Hai |

Also Read – Lower & Upper Function

Python Modules 2 Types Ke Hote Hai |

  1. In-built Modules
  2. User-Defined Modules

1. In-built Modules

Waise Python Me in-built Modules 350+ Hai, Lekin Ham Niche Ek Example Ke Sath Dekhte Hai |

Example:

help("modules")

2. User-Defined Modules

User Defined Modules Wo Modules Hote Hai, Jo User Ke Duwara Create Kiye Jate Hai, Inhe Ham Niche Example Me Dekhne Wale Hai, And Inhe Import Kaise Karte Hai ye Bhi Ham Dekhne Wale Hai |

Ab Ham Ek Simple Addition Ka Program Create Karte Hai And Is File Ka Name addition.py Rakhte Hai Uske Bad Ham Isme Addition Ka Program Banante Hai |

addition.py

def add(num1,num2):
  print(num1+num2)

Aap upper Dekh Sakte Hai, Hamne Ek File addition.py Create Ki Hai |

Ab Ham Ek file my.py Create Kar Rahe Hai, And Usme Ham addition.py file ko import karte Hai, Uske Bad add function call Karke Output Check Karte Hai |

Also Read – Python Project Ideas With Source Code

addition.py file ko my.py me import karne ke import function ka istemal Kiya Jata Hai |

my.py

import addition
addition.add(20,10)

Output:

30

Aap Upper Output Dekh Sakte Hai, Isi Tarah Se Ham Python Module ka Istemal Karte Hai |

Leave a Reply

Your email address will not be published.