Question
Find a small block of code (online) that talks about Python arrays. Implement it in Spyder Python IDE, and share your results. Share the expected
Find a small block of code (online) that talks about Python arrays. Implement it in Spyder Python IDE, and share your results. Share the expected result given online, and then share your computed result. Or, see examples of good starting points given at the end (you may pick one or come up with something similar. If you choose to do so, you will need to share hand computed or excel computed results so that I can verify them).
The code should be less than 10-15 lines. All I want to see is an input array fed to a variable, passed to a another variable that is the main function, and then your output reflecting the calculated response (which is also in an array form).
Here is an example (from our previous class):
Force = m * a. Let a = g = 9.81 m/s^2, the gravitational acceleration.
In this case, m will be an input array. The length of the array can be 5, 10, 100 datapoints (doesn't matter). Of course, don't make an array of 1-2 datapoints.
m will be passed to another variable which is the main function/expression, F = m * g.
Your computed results will be for F, which should also be an array.
Use the print statement in your code to yield the output.
Share a screenshot of Spyder. (input code will be on left, and output on bottom right).
Some good starting points:
- Equation of line, y = mx + c
- equation of parabola, y = a x**2 (in Python, exponentials are written as **)
and so forth.
Sharing just your code would work
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started