Python Forum
Program that, inside a loop, does multiple things. needs to print in a certain way
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program that, inside a loop, does multiple things. needs to print in a certain way
#1
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
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using If Statements Instead of While Loop in Simple Game Program new_coder_231013 5 3,073 Dec-14-2021, 12:23 AM
Last Post: supuflounder
  How to use list to solve things hamalainenjuho 4 1,882 Nov-14-2021, 12:57 PM
Last Post: jefsummers
  How to compile following python loop program reinispl 3 1,909 Oct-27-2021, 01:57 PM
Last Post: DeaD_EyE
  So many things wrong, it runs but not like its supposed to kasherwood 6 2,637 Sep-26-2020, 04:57 PM
Last Post: deanhystad
  Help with for-loop printing. I want it to print only once. blacklight 2 6,860 Jun-26-2020, 02:23 AM
Last Post: pyzyx3qwerty
  RockPaperScissor program while loop malfunction tonyliang19 3 2,815 Apr-03-2020, 11:09 PM
Last Post: SheeppOSU
  Print triangle using while loop tuxandrew 3 4,837 Dec-05-2019, 07:17 PM
Last Post: micseydel
  How can I run a function inside a loop every 24 values of the loop iteration range? mcva 1 2,101 Sep-18-2019, 04:50 PM
Last Post: buran
  A program for backing up documents (doesnt work(code is inside)) Richard_SS 4 3,363 Jun-05-2019, 03:47 PM
Last Post: heiner55
  Program to print: Last Name, ID, Mobile Number, All panick1992 14 9,654 Mar-15-2017, 02:46 PM
Last Post: panick1992

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020