in Python by
Q:
Mention what are the rules for local and global variables in Python?

1 Answer

0 votes
by

Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to be local.

Global variables: Those variables that are only referenced inside a function are implicitly global.

Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked Jun 28, 2020 in Python by Robindeniel
0 votes
asked Jan 11 in Python by SakshiSharma
0 votes
asked Jan 18 in Python by SakshiSharma
0 votes
asked May 25, 2020 in JAVA by Robindeniel
0 votes
asked Mar 24, 2020 in SAP by AdilsonLima
0 votes
...