Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tiempoRaton = int(input("¿Cuántos segundos le toma dar una vuelta al raton?: "))
- tiempoPato = int(input("¿Cuántos segundos le toma dar una vuelta al pato?: "))
- if tiempoRaton == 0:
- print ("Cómo la velocidad del ratón es 0 el ratón jamás alcanzará al pato")
- elif tiempoPato == tiempoRaton :
- print("Sus velocidades son iguales, por lo tanto el ratón no alcanzará al pato")
- elif tiempoPato < tiempoRaton:
- print("La velocidad del pato es mayor a la del ratón, por lo tanto el ratón no alcanzará al pato")
- elif tiempoPato > tiempoRaton:
- velpato = tiempoPato/tiempoPato
- velraton = tiempoPato/tiempoRaton
- distInPato = tiempoPato
- segundos = distInPato /(velraton-velpato)
- print (f"{round(segundos,3)} segundos tarda el ratón en alcanzar al pato con una vuelta de ventaja")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement