Fhernd icon

parcial1.py

Fhernd | PRO | 03/21/19 01:33:30 AM UTC | 0 ⭐ | 1102 👁️ | Never ⏰ | []
Python |

280 B

|

None

|

0 👍

/

0 👎

-- 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()

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎