Post

Python Programming
Python Programming@PythonPr·
What is The Difference? Drop your answer in the comments!
Python Programming tweet media
English
8
8
57
4.4K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr The difference is indentation. First code is correct → recursion works → fun(3) = 6 Second code → wrong indentation → return n * fun(n-1) is outside function → IndentationError / syntax issue Python = indentation defines logic, not just formatting.
English
0
0
2
99
xdjonns
xdjonns@JohnKaranu18680·
@PythonPr The def in the function is merged with the function name
English
0
0
1
104
แชร์