आपकी ऑफलाइन सहायता

BACK
49

सी प्रोग्रामिंग

149

पाइथन प्रोग्रामिंग

49

सी प्लस प्लस

99

जावा प्रोग्रामिंग

149

जावास्क्रिप्ट

49

एंगुलर जे.एस.

69

पी.एच.पी.
माय एस.क्यू.एल.

99

एस.क्यू.एल.

Free

एच.टी.एम.एल.

99

सी.एस.एस.

149

आर प्रोग्रामिंग

39

जे.एस.पी.





डाउनलोड पी.डी.एफ. ई-बुक्स
Python - Python Indenting Code

Python में Code indentation को काफी महत्व दिया गया है | Python में Code Indentation का इस्तेमाल functions, classes, Loops और control statements के लिए किया जाता है |

Python में curly braces({}) की जगह code indentation का इस्तेमाल किया जाता है |

Python में जब code indentation में colon(:) या delimiter दिया जाता है तब automatically अगले line पर interpreter द्वारा tab(     ) दिया जाता है |


Function

Source Code :
def func():
    a = 5
    print(a)

func()
Output :
5


For Loop

Source Code :
list = [1, 5, 8, 9]

for i in list:
    print(i)
Output :
1
5
8
9


Class

Source Code :
class myClass:
    def func():
        a = 5
        print(a)

myClass.func()
Output :
5