Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Punto 1:
- from random import random
- from matplotlib import pyplot
- caminata = []
- caminata.append(0)
- for i in range(1, 1000):
- desplazamiento = -1 if random() < 0.5 else 1
- caminata.append(caminata[i - 1] + desplazamiento)
- pyplot.plot(caminata)
- pyplot.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement