Question: Part 2 : Star Wars Planets ( 3 0 % ) In the Star Wars universe, different planets rotate at different speeds. Few are close
Part : Star Wars Planets
In the Star Wars universe, different planets rotate at different speeds. Few are close to Earth's hour rotation, which are preferential to the human characters.
Write a program that reads in from the provided SWPlanets.txt file and reports prints the name and rotational speed of the planets that are within the range of hours, inclusively.
To accomplish this, create two lists:
List should store the planet name
List should store the rotational speed of the planet
Use the created lists to report to the user print the planets meeting the above rotational speed requirement.
Your program must:
Read and adhere to all software requirements listed below.
Use a main function
Additional function usage is optional, but not required for Part Two
READ the file ONE LINE AT A TIME Do not use readlines
Required: Use a loop and if check to see if rotational speed is within the hour range.
HINTS:
You can use the string splitmethod to separate the data fields for each line read in
If you do it right, each of the lists' corresponding data should be at the same index position
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
