Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Missing Assignments

Views: 711
1
def hello(): #defines the function name to call it with
2
'''This asks for an input of a name, and then prints text along with that input.'''
3
name = input("Please enter your name: ") #asks the user for an input
4
print("Hello ",name,"!",sep="") #prints the input along with text
5
return #ends the function definition
6
7
hello()
8
9
def egg(M,T_0,T_y):
10
'''This function (egg) has a number of defined constants and takes 3 inputs - to calculate a value t and returns it.'''
11
from numpy import pi,log
12
rho = 1.038 #These are local variables relevant to the function
13
c = 3.7
14
K = 5.4E-3
15
T_w = 100
16
17
t = ((M**(2/3)*c*rho**(1/3)/\
18
(K*(np.pi**2)*(4*np.pi/3)**(2/3)))*\
19
np.log(0.76*(T_0-T_w)/(T_y-T_w)))/\
20
60
21
22
return t
23