Fuente: Coursera & Google
# Use a for loop to calculate 9!product = 1for n in range(1, 10): product = product * nprint(product)362880
# Define a function that converts Fahrenheit to Celsius.def to_celsius(x): return (x-32) * 5/9# Create a table of Celsius-->Fahrenheit conversions every 10 degrees, 0-100for x in range(0, 101, 10): print(x, to_celsius(x))0 -17.77777777777778 10 -12.222222222222221 20 -6.666666666666667 30 -1.1111111111111112 40 4.444444444444445 50 10.0 60 15.555555555555555 70 21.11111111111111 80 26.666666666666668 90 32.22222222222222
100 37.77777777777778
No hay comentarios.:
Publicar un comentario