You are on page 1of 2

mi_rimera_libreta

April 28, 2023

1 mi primer intento de porgramacion en python


[5]: 2+2

[5]: 4

1.1 la funcion fibonacci


[6]: a,b = 0,1
amax = 100
L = []

while True:
(a,b) = (b, a+b)
if a > amax:
break
L.append(a)
print(L)

[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

1.2 manipulaciones con herramientas de manejo de datos


[5]: import numpy as np
x = np.arange(1,10)
x

[5]: array([1, 2, 3, 4, 5, 6, 7, 8, 9])

[6]: x ** 2

[6]: array([ 1, 4, 9, 16, 25, 36, 49, 64, 81])

[7]: M = x.reshape((3,3))
M

[7]: array([[1, 2, 3],


[4, 5, 6],

1
[7, 8, 9]])

[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

[ ]:

You might also like