a = 20
def convert(a):
b = 20
a = a + b
convert(10)
print(a)
Select the correct output from the given options:
10
20
30
Error
In Python, variables defined inside a function are local to that function and do not affect variables outside the function. Here, the variable a inside the function convert()is a local variable, and its value does not modify the global variable a. Therefore, the value of a printed outside the function remains 20.
Balance Sheet of Atharv and Anmol as at 31st March, 2024
| Liabilities | Amount (₹) | Assets | Amount (₹) |
|---|---|---|---|
| Capitals: | Fixed Assets | 14,00,000 | |
| Atharv | 8,00,000 | Stock | 4,90,000 |
| Anmol | 4,00,000 | Debtors | 5,60,000 |
| General Reserve | 3,50,000 | Cash | 10,000 |
| Creditors | 9,10,000 | ||
| Total | 24,60,000 | Total | 24,60,000 |