πŸ“Š Python
Q. What is the output of the following program :
Code:
def myfunc(a):
a = a + 2
a = a * 2
return a
print myfunc(2)
  • (A) 8
  • (B) 16
  • (C) Indentation Error
  • (D) Runtime Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Indentation Error

Explanation: Python is strict to indentation. Here you might have noticed that the code is not properly indented. So throws an indentation error.

Explanation by: Mr. Dubey
Python is strict to indentation. Here you might have noticed that the code is not properly indented. So throws an indentation error.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
292
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
91%
Success Rate