Preparing git repo for final project
This commit is contained in:
16
problems/pset0/einstein/einstein.py
Normal file
16
problems/pset0/einstein/einstein.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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()
|
Reference in New Issue
Block a user