Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#Declaring the function with the name # of p_Pa def p_Pa(h): # Modify : Here, math import e does not # use because math e

#Declaring the function with the name

# of p_Pa

def p_Pa(h):

# Modify : Here, math import e does not

# use because math e takes the constant

# value e = 2.71 so remove this

# or you can use gamma = 133e3

# from math import e

# Compute the gamma value = 133 * 10^3 N.m^-3

gamma=133*pow(10,3)

# Return the Ppa = gamma*h + Pvapour

# but vapors pressure of mercury is very small

# So, neglect it as given in the question

# Now, return the atmospheric pressure Ppa = gamma*h

return gamma*h

# ask from the user to input the height value

h=float(input("Enter the height "))

# Call the function p_Pa

p=p_Pa(h)

# Printing the atmospheric pressure result

# Calculated by height h

print (p)

Your code failed with an exception. A traceback is below.

Here is some feedback on your code:

  • Execution time: 0.0 s -- Time limit: 10.0 s

This is the exception traceback:

Traceback (most recent call last): File "/opt/runcode/code_run_backend.py", line 255, in run_code exec(user_code, user_ctx) File "[user code]", line 33, in  RuntimeError: input(): lost sys.stdin

Can someone work on this problem so I don't get that error? Maybe there's a simpler way of figuring this out.

image text in transcribed

Creating Functions 1 point A mercury barometer is frequently used to precisely measure the atmospheric pressure. The height h of a column of mercury adjusts to a point where its weight plus force due to the mercury vapor pressure Pvapor balances the force due to the external atmospheric pressure Patm. Mathematically, we write, Pra = y + Pvapor where y is the specific weight of mercury. In SI units, y = 133 x 103 Nm 3. The vapor pressure of mercury is typically very small in relation to the other values, so we can safely neglect it (Pvapor T-25C 26.13 Pa)[NISTIR 6643] Compose a function p_Pa which calculates the atmospheric pressure in pascals given the height of a column of mercury. p_Pa should accept a height h and return the pressure in pascals as defined above. Creating Functions 1 point A mercury barometer is frequently used to precisely measure the atmospheric pressure. The height h of a column of mercury adjusts to a point where its weight plus force due to the mercury vapor pressure Pvapor balances the force due to the external atmospheric pressure Patm. Mathematically, we write, Pra = y + Pvapor where y is the specific weight of mercury. In SI units, y = 133 x 103 Nm 3. The vapor pressure of mercury is typically very small in relation to the other values, so we can safely neglect it (Pvapor T-25C 26.13 Pa)[NISTIR 6643] Compose a function p_Pa which calculates the atmospheric pressure in pascals given the height of a column of mercury. p_Pa should accept a height h and return the pressure in pascals as defined above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions