12345678910111213141516 |
- c = 300000000
- def compute_energy():
- mass = None
- while not isinstance(mass, int):
- input_string = input("Enter a mass:\t\t")
- try:
- mass = int(input_string)
- except (ValueError, TypeError):
- mass = None
- print(mass*(c**2))
- if __name__ == "__main__":
- compute_energy()
|