Question: 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
Get step-by-step solutions from verified subject matter experts
