Question: There is a Python dictionary giving information on earthquakes, first its location as the key and its value as a list of its date, time,

There is a Python "dictionary" giving information on earthquakes, first its location as the "key" and its "value" as a list of its date, time, magnitude, whether it caused damage ("D") or not ("ND"), the number of people deceased and an inner list of provinces affected, as below:
Initially we have:
E_quakes ={Bor": ["2024/02/25","13:27",5.6,"D",0,[Nigde","Adana"]],
"Gemlik": [2023/12/04","10:42,5.1,ND,0,[Bursa,"Yalova]],
"Elbistan": [2023/02/06",13:24",7.5,D,10783,[Maras","Antep","Adiyaman]],
"Pazarcik": ["2023/02/06","04:17",7.8,"D",40181,["Maras","Antep","Hatay"]],I
"Samandag": [2023/02/20","20:04",6.6,"D",11,["Hatay","Osmaniye","Adana"]]}
You are asked to write the PYTHON program that will :
a) ask the user additional earthquake information and add these to this database until he prints "EOD" as the next location,
b) then sorts this new dictionary in ascending order according to location names,
c) afterwards compiles another dictionary, where the keys are dates in descending order and their values are locations,
d) finally prints these two dicitonaries.
 There is a Python "dictionary" giving information on earthquakes, first its

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!