Python Forum

Full Version: Program that, inside a loop, does multiple things. needs to print in a certain way
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Write a Python program that, inside a loop, does several things:
a)Asks the user for values of mass in kg, damping in N/(m/s), and stiffness in N/m and
appends the user's values to the ends of list variables that were initially set to empty.
b) Prints out the natural frequency in Hz and the damping ratio.
c) Asks the user if they want to continue

Then, when the user is done entering values, leave the loop. Print out a neat table with the user's values, the values for natural frequency and damping ratio, and the type system response, as given above. The table should start with header and unit rows, as shown in the example run below. Numerical values should be formatted wide enough to make neat columns and show 4 digits to the right of the decimal.

Below is a link to the question and the question background
https://imgur.com/gallery/fHPfyvK

The end result of the program needs to be in an organized chart like this:
https://imgur.com/a/FM0XBeb



This is what I have so far, I don't know how to clean or organize it into a chart
https://imgur.com/gallery/PrrOMGX
Can you see the little yellow and blue button on the toolbar? click that and put your code between it.

Also look into the pprint library for pretty printing.