Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am getting an extra decimal place for max weight not sure what I am missing please help main.py Load default template... 1 weights [float(inputEnter

image text in transcribed

image text in transcribed

I am getting an extra decimal place for max weight not sure what I am missing please help

main.py Load default template... 1 weights [float(inputEnter weight 1: )), float(input 'Enter weight 2: ')), float (input ( Enter weight 3:n)) float(input('Enter weight 4: '))] 3 4 5 6 7 print("Weights:", weights) print ("Average weight : print( "Max weight: %.2f. % (max(weights))) print (Weight %.2f. % (sum(weights)/len (weights))) 9 index int (input(nEnter a list index (1 4): ') 10 11 12 in pounds: %.2f, % weights [index-1]) in kilograms : %.2f . % (weights[index-1]/22)) print (weight 13 print(sorted list:', sorted(weights)) Enter weight 1: Enter weight 2: Enter weight 3: Enter weight 4: Your output starts Weights: [236.0, 89.5, 176.0, 166.3] with Average weight: 166.95 Max weight: 236.00 Enter a list index (1 - Weight in pounds: 176.0 Weight in kilograms: 80.0 4): Enter weight 1: Enter weight 2: Enter weight 3: Enter weight 4: Expected output Weights [236.0, 89.5, 176.0, 166.3] starts with Average weight: 166.95 Max weight: 236.0 Enter a list index (1 - 4): Weight in pounds: 176.0 Weight in kilograms: 80.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions