Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f40eccd

Browse files
author
Amogh Singhal
authored
Update Python_Programming_Quiz.md
1 parent 9ec4987 commit f40eccd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎Python_Programming_Quiz.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,17 @@ Operator | Description |
142142
`%=` | Modulus and Assign |
143143
`**=` | Exponent and Assign |
144144
`//=` | Floor Divide and Assign |
145+
146+
#### 8. What is recursion ? <br>
147+
When a function makes a call to itself, it is termed recursion.<br>
148+
But then, in order for it to avoid forming an infinite loop, we must have a base condition.<br>
149+
150+
Let’s take an example. <br>
151+
```
152+
def facto(n):
153+
if n==1:
154+
return 1
155+
return n*facto(n-1)
156+
157+
facto(4) # This will compute 4x3x2x1 = 24
158+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /