Answered step by step
Verified Expert Solution
Question
1 Approved Answer
code the following in python: below is the .txt file 1. P2.6.3 Your program should output the ESI of each body (to 4 places after
code the following in python:
below is the .txt file
1. "P2.6.3 Your program should output the ESI of each body (to 4 places after the decimal) in a clean string. As a check for your work, note that the ESI of Mars is about 0.7. Note also that the .txt file used in this problem has a problematic format: columns are separated by spaces, but the entries in the first column also contains spaces! To get around this, note that once you have a line assigned to object 's,you can do something like: s -s.Istrip() # remove leading whitespace index s, find(, ,) # find the location of the first 'two spaces. obj -s[index] # call out the object name s s[index+2:] # then truncate the string to everything else
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started