Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. tiempoRaton = int(input("¿Cuántos segundos le toma dar una vuelta al raton?: "))
  2. tiempoPato = int(input("¿Cuántos segundos le toma dar una vuelta al pato?: "))
  3.  
  4. if tiempoRaton == 0:
  5. print ("Cómo la velocidad del ratón es 0 el ratón jamás alcanzará al pato")
  6.  
  7. elif tiempoPato == tiempoRaton :
  8. print("Sus velocidades son iguales, por lo tanto el ratón no alcanzará al pato")
  9.  
  10. elif tiempoPato < tiempoRaton:
  11. print("La velocidad del pato es mayor a la del ratón, por lo tanto el ratón no alcanzará al pato")
  12.  
  13. elif tiempoPato > tiempoRaton:
  14. velpato = tiempoPato/tiempoPato
  15. velraton = tiempoPato/tiempoRaton
  16. distInPato = tiempoPato
  17. segundos = distInPato /(velraton-velpato)
  18. 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