Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a dictionary to store days as key and number for each dayas follows. Write a Python script to sort this dictionary BY VALUEin ascending

Create a dictionary to store days as key and number for each dayas follows. Write a Python script to sort this dictionary BY VALUEin ascending and descending orders. Print out the results asfollows,

image

1. Create a dictionary to store days as key and number for each day as follows. Write a Python script to sort this dictionary BY VALUE in ascending and descending orders. Print out the results as follows, {"Tuesday": 2, 'Sunday': 7, 'Monday': 1, 'Thursday': 4, 'Friday': 5, 'Wednesday': 3, 'Saturday': 6} Output in ascending order: Monday => 1 Tuesday => 2 Wednesday => 3 Thursday => 4 Friday => 5 Saturday => 6 Sunday => 7 Output in descending order: Sunday => 7 Saturday => 6 Friday => 5 Thursday => 4 Wednesday => 3 Tuesday => 2 Monday => 1

Step by Step Solution

3.54 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

Python version 36 Python program to create a dictionary and then display the contents of the diction... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Using Excel & Access for Accounting 2010

Authors: Glenn Owen

3rd edition

1111532672, 978-1111532673

More Books

Students also viewed these Programming questions

Question

What is the purpose of bond ratings?

Answered: 1 week ago