Watch the video & complete the Trinket coding examples.
Imagine you are an engineer making a widget & you need to convert from inches to millimeters. Perform the calculation & print out the length of the widget in mm.
Write the code to
1) Calculate a widget length of 5 inches to millimeters.
Hint: 5 x 25.4
2) Use a print statement to say "This widget is _____ mm long."
Imagine you are an engineer making widgets and you have 3 items that you need to convert from inches to millimeters.
Watch the video & complete the Trinket coding examples.
1. Run the Code to the Right to calculate the Widget sizes in millimeters.
▶ Click Run
2. Alter the code to include 10 different widget sizes.
▶ Click Run
Let's learn more about what an array is and how it can be useful in Scientific Computing!
Arrays can be used to make mathematical calculations with ease. Let's take a look at how we perform math operations on arrays using libraries.
What are libraries in Python?
Libraries are prewritten code which allow us to implement commands to make our lives easier.
Libraries contain functions and capabilities that you can use without having to actually write the code to perform the tasks at hand!
Throughout these lessons, several Python Packages are referred to such as Numpy, Matplotlib, Pandas, etc...
These libraries have a lot of functionality that we will not fully cover. You can search on Google or check out this link here to learn more about their capabilities.
Throughout these lessons, several Python Packages are referred to such as Numpy, Matplotlib, Pandas, etc... Here is a summary link of what is included in each.
Make note of a few items in
1) Numpy
2) Pandas
3) Matplotlib
Python makes importing libraries easy!
You simply import it on your code box like so:
Watch the video to learn how to import libraries and to define a shortened 'alias' name for them.