I wrote my code to this but I just can't figure out what the heck i'm doing wrong to get it to work.. I will attach my code and the problem for python program4_2.py Write a program that displays a table of inches and equivalent lengths in centimeters using f-strings. You can find the conversion factor online if necessary. Store this factor in a properly named constant. Allow the user to specify the range of inches for the table by prompting for the start, stop, and step values for the inches column. Display the inches accurate to one decimal place left-aligned in a column 8 characters wide. The centimeters should display accurate to two decimal places and centered in a column 12 characters wide (see page 75-78). Column headings should be displayed using the same widths alignments.  inches=2.54 start=int(input('Enter the start for inches ')) stop=int(input('Enter the stop for inches ')) step=int(input('Enter the step for inches '))   for inches in range (start, step + 1): centimeters = start * inches print () print('inches\tcentimeters') print(f'{inches:<8.1f}\t{centimeters:^12.2f}')

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I wrote my code to this but I just can't figure out what the heck i'm doing wrong to get it to work.. I will attach my code and the problem for python program4_2.py
Write a program that displays a table of inches and equivalent lengths in centimeterusing f-strings. You can find the conversion factor online if necessary. Store this factor in a properly named constant. Allow the user to specify the range of inches for the table by prompting for the start, stop, and step values for the inches column. Display the inches accurate to one decimal place left-aligned in a column 8 characters wide. The centimeters should display accurate to two decimal places and centered in a column 12 characters wide (see page 75-78). Column headings should be displayed using the same widths alignments

inches=2.54
start=int(input('Enter the start for inches '))
stop=int(input('Enter the stop for inches '))
step=int(input('Enter the step for inches '))

 

for inches in range (start, step + 1):
centimeters = start * inches
print ()
print('inches\tcentimeters')
print(f'{inches:<8.1f}\t{centimeters:^12.2f}')

 

 

Enter the start for inches 4
Enter the stop for inches 36
Enter the step for inches 4
INCHES CENTIMETERS
4.0
10.16
8.0
20.32
12.0
30.48
16.0
40.64
20.0
50.80
24.0
60.96
28.0
71.12
32.0
81.28
36.0
91.44
Transcribed Image Text:Enter the start for inches 4 Enter the stop for inches 36 Enter the step for inches 4 INCHES CENTIMETERS 4.0 10.16 8.0 20.32 12.0 30.48 16.0 40.64 20.0 50.80 24.0 60.96 28.0 71.12 32.0 81.28 36.0 91.44
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education