Commit 8f0c1646 authored by Tom Niget's avatar Tom Niget

Add extension example

parent e8ce3013
import pyext
print("Imported:", pyext.add(5, 3), pyext.fibo(10))
\ No newline at end of file
# coding: utf-8
# extension
def add(x, y):
return x + y
def fibo(n):
res = [0, 1]
for i in range(2, n):
res.append(res[i - 1] + res[i - 2])
return res
if __name__ == "__main__":
print("Python:", add(5, 3), fibo(10))
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment