Put the lesson Array Operations into practice by writing a program yourself.
You have the density (g/cm³) and yield strength (MPa) of six alloys. Specific strength, strength divided by density, measures how strong a material is for its weight.
Calculate it for every alloy at once, then find the alloys with a specific strength above 100.
np.round().['Al 6061' 'Al 7075' 'Ti-6Al-4V' 'Mg AZ31'] [102.2 179. 198.6 113. ]
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
import numpy as npnames = np.array(["Al 6061", "Al 7075", "Ti-6Al-4V", "Steel 1020", "Mg AZ31", "Cu C11000"])density = np.array([2.70, 2.81, 4.43, 7.87, 1.77, 8.96]) # g/cm³yield_strength = np.array([276, 503, 880, 350, 200, 70]) # MPaspecific = yield_strength / densityis_strong = specific > 100print(names[is_strong])print(np.round(specific[is_strong], 1))