the-honk/school/a-level/y12 old school/fundementals/einstein.py

11 lines
214 B
Python

c = 299792458
while True:
try:
m = int(input('Please enter an integer mass in kg: '))
break
except ValueError:
print('Please ensure that your input was an integer!')
e = m * (c ** 2)
print(f'e = {e:,}J')