from math import log, pi
# set up constants
= 47.0
Msmall = 67.0
Mbig = 1.038
rho = 3.7
c = 0.0054
K = 100.0
Tw = 70.0
Ty
= bool(input("Is the egg large (1) or small (0)? "))
whichEgg
if (whichEgg == 0):
= Msmall
M else:
= Mbig
M
print("enter the initial temperature of the egg")
= float(input("reminder 4.0 for fridge, 20.0 for room: "))
To
= (((M**(2.0/3.0))*c*(rho**(1.0/3.0)))/(K*(pi**2)*((4.0*pi/3.0)**(2.0/3.0)))) * log(0.76 * ((To-Tw)/(Ty-Tw)))
t
= int(t/60.0)
t_min = round(t % 60)
t_sec
print(f"The time taken to cook the egg is: {t:.3f} seconds ({t_min:d} minutes, {t_sec:d} seconds)")
Cooking a perfect egg
sample solution