PHYCS 3730/6720 Lab Exercise

Reading and references: Tables of numbers are easier to read if the columns line up. Here we practice with numeric output format.

Answer file Mylab13.txt.

Exercise 1. Temperature conversion

Write a Python script for printing a two-column table to your screen for converting fever-thermometer temperatures from degrees Centigrade to Farenheit. Do this for temperatures from 35 C to 40 C in increments of 0.2 degrees. Put headers "C", and "F" over the columns. Display all temperatures with one digit after the decimal point. When you are done, copy your code and your table to the exercise file for handing in.

In case you have forgotten, F = 32 + C*9/5.


Exercise 2. Prettifying your Assignment 4 output

Modify your code truss.py from Assignment 4 so it prints a neat table of values for the tensions/compressions on each bridge member. Print them in a single column with no digits after the decimal point.

Note, if your solution for the tensions/compressions is an n x 1 numpy matrix, you will need to give two subscripts to specify the matrix element. Otherwise, Python's "format" will complain.

In your answer file, copy just the part of your code that does the printing, and also copy the resulting table.