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

What is python software?
Python is a dynamic and interpreted programming language. It is good for shell scripting, web development using django,flask framework and lot of package for data science inbuild make it a all round programming...
Vikram
Which is better, PHP or Python? Why?
This question points to other question , What motive you want to learn or what you want to achive with them.
Issac
0 0
8
Which Python should I learn, Python 2.7 or 3.x?
Better to learn latest versions always. You cannot find much differences. If you learn one version remaining versions you can understand easily.
Swapna
0 0
7
What are common uses of Python decorators?
Python decorators are commonly used for: 1. *Logging*: Adding logging functionality to functions or methods. 2. *Authentication*: Checking user permissions or authentication before executing a function. 3....
Narasimha
0 0
5

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/Dejango Training
Python/Django Training Content Duration: 2.5 months 1. Introduction to Python Python - The Universal Language 2. Getting Started Installing Python Python - *Hello World* Using the Interpreter Python...

OS Module
1. OS module interacts with your operating system. Use this to create folder, remove folder, move folder, change the working directory. Ex: import oscurDir=os.getcwd() #get current working directoryprint(curDir)os.mkdir('praveen')...

What is the difference between PHP and PYTHON
Let's start with PHP: - Ideal for standard web development- Easy integration with MySQL- $_GET and $_POST built into the language- C-Esque syntax Primarily used on an Apache server (Routinely, you...

Writing Simple programs in Python(cont.)
To start writing simple programs in Python, we have to know firstly the SW development process and then we also have to know a bit about the language in which we wish to code,in this case,python, to get...

Write a python program to display dictonary details from list of dictonary
Print the Following: Print all dictonary in a seperate line. Name of all the products. Total quantity of all the products. Details of any product name when provided. Convert all the product name to upper case and print.
A

Ankit P.

0 0
0

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