Included below are some of the python scripts I wrote or edited for NR 533 Triangle.py and Slope.py These two scripts demonstrate basic scripting concepts such as defining functions, if/else loops and user input. Triangle.py takes "height" and "base" information from a user and calculates various the triangle parameters. Slope.py takes in the x and y coordinates for two points from a user and calculates the slope of the line between them.
Temperature.py This script uses branching to convert between Celsius and Fahrenheit and vice versa. It takes user input and prints out the results.
Grid.py This script works with matrices. It calculates the size, sum of values, average, min and max value, and the range of values. Additionally, it is able to display the values for a selected row, selected column and a selected cell.
Dictionary.py This script reads in a tab delineated text file and calculates output based on the value of each row.
|