Article Outline
Python example 'python-example-28'
Functions in program:
def age(n):
python-example-28
Python example: python-example-28
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def age(n):
if n == 1: c = 10
else: c = age(n - 1) + 2
return c
print(age(5))
Useful links
- Learn Python: https://pythonbasics.org/
- More Python: https://pythonprogramminglanguage.com