हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

Write the basic rules for a global keyword in python. - Computer Science

Advertisements
Advertisements

प्रश्न

Write the basic rules for a global keyword in python.

टिप्पणी लिखिए

उत्तर

The basic rules for the global keywords in Python are:

  1. When we define a variable outside a function, it’s global by default. You don’t have to use global keywords.
  2. We use a global keyword to read and write a global variable inside a function.
  3. Use of global keywords outside a function has no effect.
shaalaa.com
Variable Scope
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Python functions - Evaluation [पृष्ठ ११३]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
अध्याय 7 Python functions
Evaluation | Q 2. | पृष्ठ ११३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×