UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is an example of a practical use of a dictionary(map) in a Python 3 program?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

Computer Trainer: Programming & Software Development.

Dictionary in python are used to store key-value pair. Now suppose their are 5 students in a class, having roll no. 1 to 5. Each have Maths, Physics & chemistry as subject. Now suppose we want to PROCESS this data, for example we want to arrange them in decreasing order of marks in Maths, i.e. student...
read more
Dictionary in python are used to store key-value pair. Now suppose their are 5 students in a class, having roll no. 1 to 5. Each have Maths, Physics & chemistry as subject. Now suppose we want to PROCESS this data, for example we want to arrange them in decreasing order of marks in Maths, i.e. student having highest marks marks in maths is at the top of the list. We can write this data in the following way d={1:[54,67,88], 2:[24,67,56], 3:[99,12,78], 4:[55,33,44], 5:[11,58,79]} # where first element of each list is marks of Maths f=sorted(d,key=d.get, reverse=True) for r in f: print(r, d[r][0]) # This gives the output of roll number of students with max to min marks in Maths # OUTPUT 3 99 4 55 1 54 2 24 5 11 I hope this helps you understand how we can use dictionaries in python. read less
Comments

Related Questions

Which website should I learn Python from?
Please refer documentation provided by Python Website https://docs.python.org/3/reference/index.html
Abirami
0 0
5
Is there any online Python coaching classes available?
Yes it is. You can contact me and visit my profile for Online classes
Abhishek
0 0
5
Which technology is better to learn Linux, java or python to get a good job please help me out in this?
If you have to absolutely choose only one of the three and are not from computer science stream, definitely Python and if you are from computer science stream, Java. If no restriction, choose both. and...
Sai

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Python Programming or R- Programming
Most of the students usually ask me this question before they join the classes, whether to go with Python or R. Here is my short analysis on this very common topic. If you have interest/or having a job...

Decorators In Python
A decorator takes in a function, adds some functionality and returns it. Functions and methods are called callable as they can be called. Any object which implements the special method __call__() is...

Python (Concepts and Importance)
Python is a general-purpose, interpreted, object-oriented programming language. Python was created by "G. V. Rossum" in the Netherlands in 1990. Python has become a famous programming language widely used...

A program to determine the molecular weight of a hydrocarbon based on the number of Hydrogen,Carbon and Oxygen atoms.
import osimport math# A program to calculate Molecular Weight of a Hydrocarbon # These are the atomic weights(grams/mole) of Hydrogen,Carbon and OxygenatomicwtH = 1.0079atomicwtC = 12.011atomicwtO = 15.994Hatoms...

Python breaks into the top three programming languages in the Tiobe Index for the first time.
Python breaks into the top three programming languages in the Tiobe Index for the first time. The popularity of Python shows no sign of waning, with the programming language entering the top three in...

Recommended Articles

Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Looking for Python Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more