parent
0799636082
commit
228049c859
3 changed files with 38 additions and 19 deletions
@ -0,0 +1,17 @@ |
||||
def gen_fib(count): |
||||
i = 1 |
||||
if count == 0: |
||||
fib = [] |
||||
elif count == 1: |
||||
fib = [1] |
||||
elif count == 2: |
||||
fib = [1,1] |
||||
elif count > 2: |
||||
fib = [1,1] |
||||
while i < (count - 1): |
||||
fib.append(fib[i] + fib[i-1]) |
||||
i += 1 |
||||
|
||||
return fib |
||||
|
||||
print(gen_fib(10)) |
||||
@ -0,0 +1,5 @@ |
||||
import numpy as np |
||||
|
||||
arr = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]) |
||||
|
||||
print(arr[1, 1:4]) |
||||
Loading…
Reference in new issue