Question: Write the code in python. 5. Write a function that takes a numeric value (x) and returns O if x is less than 0, returns
Write the code in python.
5. Write a function that takes a numeric value (x) and returns O if x is less than 0, returns x if x is between 0 and 1, returns 1 if x is greater than 1. 6. Using a For loop, multiply the sequence of numbers "3,4,5,6,7" by 7 and print the result of each iteration. Your output should be 21, 28, 35, 42, 49. 7. Write a function that takes the variables: load (in N), diameter (in m), elastic_modulus (in GPa), and yield_strength (in MPa). The function should return "not elastic" if the applied stress is greater than the yield_strength and return the strain if the applied stress is less than or equal to the yield_strength. The strain should be calculated using Hooke's law
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
