filmov
tv
Python - Dictionary: Create, Retrieve, Update, Delete, Pop etc.

Показать описание
In this video we will have a discussion about Dictionary data type of python.
Dictionary is a very important datatype and it can store values along with a key. So the retrieval of the information is very fast. I will show you how we can create a dictionary, add elements, retrieve them, and delete them. These are some basic operations on a dictionary data type.
And then we will perform below mentioned task using dictionaries.
You have a record of N students. Each record contains the student's name, and their percent marks in Maths, Physics and Chemistry. The marks can be floating values. The user enters some integer N followed by the names and marks for N students. You are required to save the record in a dictionary data type. The user then enters a student's name. Output the average percentage marks obtained by that student, correct to two decimal places.
Sample Input
3
Krishna 67 68 69
Arjun 70 98 63
Aman 52 56 60
Aman
56.00
Dictionary is a very important datatype and it can store values along with a key. So the retrieval of the information is very fast. I will show you how we can create a dictionary, add elements, retrieve them, and delete them. These are some basic operations on a dictionary data type.
And then we will perform below mentioned task using dictionaries.
You have a record of N students. Each record contains the student's name, and their percent marks in Maths, Physics and Chemistry. The marks can be floating values. The user enters some integer N followed by the names and marks for N students. You are required to save the record in a dictionary data type. The user then enters a student's name. Output the average percentage marks obtained by that student, correct to two decimal places.
Sample Input
3
Krishna 67 68 69
Arjun 70 98 63
Aman 52 56 60
Aman
56.00