Planets={
'Mercury':{
'Radius':2439.7,
'Distance from the sun':58,
'Moons':[],
'Atmosphere?':'True',
'Gas planet?':'False',
},
'Venus':{
'Radius':6051.8,
'Distance from the sun':108,
'Moons':[],
'Atmosphere?':'True',
'Gas planet?':'False'
},
'Earth':{
'Radius':'6371.0',
'Distance from the sun':'150',
'Moons':['Moon'],
'Atmosphere?':'True',
'Gas planet?':'False'
},
'Mars':{
'Radius':3396.2,
'Distance from the sun':207,
'Moons':['Phobos','Deimos'],
'Atmosphere?':'True',
'Gas planet?':'False'
},
'Jupiter':{
'Radius':69911,
'Distance from the sun':483,
'Moons':['Io', 'Ganymede', 'Callisto', 'Europa', 'Adrastea'],
'Atmosphere?':'True',
'Gas planet?':'True'
},
'Saturn':{
'Radius':60268,
'Distance from the sun':1400,
'Moons':['Pan', 'Prometheus', 'Titan', 'Phoebe', 'Rhea'],
'Atmosphere?':'True',
'Gas planet?':'True'
},
'Uranus':{
'Radius':25559,
'Distance from the sun':3000,
'Moons':['Miranda', 'Ariel', 'Umbriel', 'Titania', 'Oberon'],
'Atmosphere?':'True',
'Gas planet?':'True'
},
'Neptune':{
'Radius':24764,
'Distance from the sun':4500,
'Moons':['Triton', 'Nereid', 'Proteus', 'Naiad', 'Thalassa'],
'Atmosphere?':'True',
'Gas planet?':'True'
},
}
for key in Planets.keys():
print(key)
print("\n".join(["{0}:{1}".format(k,v) for k,v in Planets[key].items()]))
for example how would i find, What planet is closest to the sun with at least 2 moons?, can someone please show me an example it would be really helpful

New Topic/Question
Reply



MultiQuote





|