Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 In the code box below, install Pint and import the function UnitRegistry from Pint. [ ] from pint import UnitRegistryQuestion 4 Sometimes, we

Question 3In the code box below, install Pint and import the function UnitRegistry from Pint.[]from pint import UnitRegistryQuestion 4Sometimes, we wish to rename the default functions from libraries, just as a matter of convenience. In the code box below, rename UnitRegistry() as units.[]units = UnitRegistry()Question 5In the code box below, install NumPy import the square root function, pi, the sine function and cosine function from NumPy.[]from numpy import pi, sin, cosQuestion 6Compute2(/4)+2(/4)in the code box below.[]from numpy import sin, cossin(pi/4)**2+ cos(pi/4)**21.0Question 7In this question, h has already been defined to be the height of the Empire State Building in meters.Suppose you bring a 10 foot pole to the top of the Empire State Building and use it to drop the penny from h plus 10 feet.Define a variable named foot that contains the unit foot provided by the UnitRegistry we called units. Define a variable named pole_height and give it the value 10 feet.What happens if you add h, which is in units of meters, to pole_height, which is in units of feet? What happens if you write the addition the other way around?[]h =381* units.meter[]foot = units.footpole_height =10* footh + pole_height[]pole_height + hQuestion 8Why would it be nonsensical to add a and t? What happens if you try?[]a =9.8* units.meter / units.second**2t =3.4* units.second[]a + tIn this example, you should get a DimensionalityError, which indicates that you have violated a rule of dimensional analysis: you cannot add quantities with different dimensions.The error messages you get from Python are big and scary, but if you read them carefully, they contain a lot of useful information.The last line usually tells you what type of error happened, and sometimes additional information, so you might want to start from the bottom and read up.The previous lines are a traceback of what was happening when the error occurred. The first section of the traceback shows the code you wrote. The following sections are often from Python libraries.Question 9Suppose I run a 10K race in 44:52(44 minutes and 52 seconds). What is my average pace in minutes per mile? (Note that 10k means 10 kilometers).

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_2

Step: 3

blur-text-image_3

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions