在线编译器 Python

a = int(input("Primo numero: ")) b = int(input("Secondo numero: ")) somma = a + b print("La somma è:", somma)
This code reads two integers from the user, adds them together, and prints the result with a short message.

- The input function returns a string, so int() is needed to convert it before adding; check that both conversions happen before the addition.
- If the user types something that is not a whole number, int() will raise an error; think about what kind of input the program expects.