Advertisement
teslariu

formateo de salida

Jan 14th, 2023
749
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. """
  5. # Script que pide dos numeros por teclado e imprime su producto y su suma
  6. # Ejemplo (los nros pueden ser enteros o float, como uds quieran)
  7. # >>> Ingrese un numero: 1
  8. # >>> Ingrese otro numero: 2
  9. # >>> La suma entre 1 y 2 es 3 y el producto 2
  10.  
  11. a = float(input("Ingrese un numero: "))
  12. b = float(input("Ingrese otro numero: "))
  13. print(f"La suma entre {a} y {b} es {a+b} y el producto {a*b}")
  14. """
  15.  
  16. # Script que convierte una temp de ºF a ºC
  17.  
  18. temp = float(input("Ingrese la temperatura (en ºF): "))
  19. print(f"{temp}ºF equivalen a {(temp - 32) / 1.8:.1f}ºC")
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement