function in Python in hindi

Function

Function in real life 
   Function in programming को समझने से पहले ये समझते है कि function in real life क्या है । तो मान लो आप कोई भी task कर रहे ही जैसे eating हो गया , running हो गया , cycling हो गया । आप क्या कर रहे हो एक task कर रहे हो और इस task मैं multiple चीजे involved होती है जैसे आप खा रहे हो खाते समय आपके एक हाथ मे फोग ओर दूसरे हाथ है स्पून । आपके दोनों हाथ चल रहे है और साथ आपका मुह से उसे चबा रहै हो जिसे function कहते है ।

   ऐसे ही running मैं भी आप multiple task करते हो 
  cycling मैं भी आप multiple task करते हो एक ही time पे । 
   Function मतलब आप एक specific task कर रहे हो और उस task मैं multiple चीजे involved है उसे हम function कहते है 

  उसी concept को अगर आप programming world मैं लाओ तो उसी को function in programming बोलते है ।
  
   Function is a block of code which performs a specific task . 
   तो एक block of code है मतलब multiple lines of code है उस multiple lines of code से आप कोई specific task कर सकते हो । 
   तो इसका  example जो है online banking का ले सकते है या फिर जब आप ATM जाते है तो उसका आप example ले सकते हो मानलो आप ATM गए हो और आपको पैसे WITHDRAW करना हो और line मैं 100 लोग खड़े है तो उन 100 लोगो के लिए 100 line of code लिखना हो । तो इतना repetitive task करने के बदले आपको 100 line of code का withdraw function लिखना होगा और ये withdraw function जो है बाकी सब सम्भाल लेगा । मतलब आपको अलग अलग लोगो के लिए अलग अलग 100 line of code नही लिखना है आपको बस एक बार code लिखना है और उस function का नाम withdraw लिखना है बाकी का सब वो withdraw function देख लेगा । 

    


Post a Comment

0 Comments