Queer European MD passionate about IT

einstein.py 328 B

12345678910111213141516
  1. c = 300000000
  2. def compute_energy():
  3. mass = None
  4. while not isinstance(mass, int):
  5. input_string = input("Enter a mass:\t\t")
  6. try:
  7. mass = int(input_string)
  8. except (ValueError, TypeError):
  9. mass = None
  10. print(mass*(c**2))
  11. if __name__ == "__main__":
  12. compute_energy()