HW5Q6

 avatar
user_7676782
python
2 years ago
158 B
1
Indexable
Never
def numOfCandles(n):
    if n == 1:
        return 2
    else:
        return n + 1 + numOfCandles(n - 1)


candles = 8
print(numOfCandles(candles))