Question: Write Python code to do the following: Create three lists called stars, absmags , and distances containing Now create a new list, appmags, containing apparent

Write Python code to do the following:
Create three lists called stars, absmags, and distances containing
Now create a new list, appmags, containing apparent magnitudes m calculated
using
m=M+5(logd-1)
where M is the absolute magnitude and d is the distance in parsecs. Note that
the logarithm is base-10, so use the log10 function from the math module.
Iterate over the stars, printing for each star "The apparent magnitude of (star) is
(appmag)."
Practice with dictionaries by creating a dictionary for one of the stars. The keys
should be 'm','M', and 'd', and the values should be the apparent magnitude and
so on as appropriate.
Now use the data in the four lists to create a nested dictionary called stardict.
Each dictionary entry should have as its key the name of a star, and the value
should be itself a dictionary like the one you created in #4 above.
Print stardict ['Rigel']['m'].
 Write Python code to do the following: Create three lists called

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!