subject
Engineering, 10.02.2020 23:04 dayanara72

Create a new Python script. Write a function to do each of these tasks. Also, put code in your script to call and test these functions.

Functions to write:

a) A function that takes in a person's name as a parameter, and prints that name 5 times, each on its own line. Test with different names.

b) A function that takes two parameters - a person's name, and a number of times to print the name, once per line.

c) A function that takes two parameters corresponding to the a and b sides of a right triangle. Have the function print out the hypotenuse of the triangle using the Pythagorean Theorem ( you'll need the math. sqrt() function).

d) A function that takes three parameters corresponding to the a, b, and c values of a quadratic equation. Use the quadratic formula to calculate both roots for the given a, b, and c values and print them out.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
A-mn has a cubic structure with a0 0.8931 nm and a density of 7.47 g/cm3. b-mn has a different cubic structure, with a0 0.6326 nm and a density of 7.26 g/cm3. the atomic weight of manganese is 54.938 g/mol and the atomic radius is 0.112 nm. determine the percent volume change that would occur if a-mn transforms to b-mn.
Answers: 2
question
Engineering, 04.07.2019 18:10
True or false (explain) (110)[111] is a slip system in bcc metals . the {111} family in fcc contains 8 planes. resolved shear stress (rss) in single crystals is just related to the applied stress. critical resolved shear stress (crss) in single crystal metals is direct proportional to the number of defects in the structure
Answers: 2
question
Engineering, 04.07.2019 19:10
Aplate of dimensions 3 m x 3 m is placed 0.37 mm apart from a fixed plate. the plate requires a force of 2n to move at speed of 45 cm/s. evaluate the viscosity of the fluid in between the plates
Answers: 3
question
Engineering, 04.07.2019 19:10
Acircular aluminum shaft mounted in a journal is shown. the symmetric clearance gap between the shaft and journal is filled with sae 10w-30 oil at t 30°c. the shaft is caused to turn by the attached mass and cord. develop and solve a differential equation for the angular speed of the shaft as a function of time.
Answers: 2
You know the right answer?
Create a new Python script. Write a function to do each of these tasks. Also, put code in your scrip...
Questions
question
Mathematics, 28.03.2021 08:30
question
History, 28.03.2021 08:30
question
Arts, 28.03.2021 08:30
question
Arts, 28.03.2021 08:30
Questions on the website: 13722361