Wednesday, April 29, 2020

FINDING THREE HIGHEST VALUES IN A DICTIONARY IN PYTHON


Write a program to find the three highest values in a dictionary and display the result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



my_dict = {'A': 40, 'B': 60, 'C': 100,
           'D': 20, 'E': 90, 'F': 80}

k = Counter(my_dict)
# Finding 3 highest values
high = k.most_common(3)

print()
print("\tFINDING THREE HIGHEST VALUES IN A DICTIONARY")
print()
print("\tInitial Dictionary:")
print()
print("\t",my_dict, "\n")
print("\tDictionary with 3 highest values:")
print("\tKeys: Values")
print()
for i in high:
    print("\t",i[0],":", i[1],"")
    print()
print("\tEND OF PROGRAM”)

CREATING A NESTED DICTIONARY IN PYTHON


Write a program to create nested dictionary and display the result on the screen.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



display_dictionary = {1: 'Fundamentals', 2: 'of', 3: 'Python Programming',
        4: {'A': 'Welcome', 'B': 'To', 'C': 'Bacolod City'}}
print()
print("\tCREATING A NESTED DICTIONARY")
print()
print("\tDISPLAY RESULT")
print()
print("\t",display_dictionary);
print()
print("\tEND OF PROGRAM").

COMBINE THREE DICTIONARY ADDING VALUES FOR COMMON KEYS IN PYTHON


Write a program to combine two dictionary-adding values for common keys and display the result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



from collections import Counter
a1 = {'a': 10, 'b': 20, 'c':30}
a2 = {'a': 20, 'b': 10, 'c':40}
a3 = {'a': 30, 'b': 40, 'c':20}

display_result = Counter(a1) + Counter(a2) + Counter(a3)
print()
print("\tCOMBINE THREE DICTIONARY ADDING VALUES FOR COMMON KEYS")
print()
print("\tDISPLAY RESULT")
print()
print("\t",display_result)
print()
print()
print("\tEND OF PROGRAM")

ITERATE OVER DICTIONARIES USING FOR LOOPS IN PYTHON


Write a program to iterate over dictionaries using for loops and display the result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing




display = {'a': 5,'b':10,'c':15,'d':20,'e':25}

print()
print("\tITERATE OVER DICTIONARIES USING FOR LOOPS")
print()
print("\tDISPLAY RESULT")
print()
for dict_key, dict_value in display.items():
    print("\t",dict_key,'->',dict_value)
print()
print("\tEND OF PROGRAM")

ADD NEW ITEM IN THE DICTIONARY IN PYTHON



Write a program to add an item in the dictionary and display the result on the screen.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing

add_item =    {

  "brand": "Hyundai",
  "model": "Accent",
  "year": 2012
}

add_item["color"] = "red"
print()
print("\tADD NEW ITEM IN THE DICTIONARY")
print()
print("\tDISPLAY RESULT")
print()
print("  ",add_item)
print()
print("\tEND OF PROGRAM");



CHECK IF A GIVEN KEY ALREADY EXISTS IN A DICTIONARY IN PYTHON


Write a program to check if a given key already exists in a dictionary and display the result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



list = {1:5,2:10,3:15,4:20,5:25,6:30,7:35,8:40}

def check_key(a):
  if a in list:
      print('\tThe key {0} is present in the dictionary.'.format(a))
  else:
      print('\tThe key {0} is not present in the dictionary.'.format(a))

print()
print("\tCHECK IF A GIVEN KEY ALREADY EXISTS IN A DICTIONARY")
print()
print("\tDISPLAY RESULT")
print()
check_key(7);
print()
print("\tEND OF PROGRAM");

SUM OF ALL THE ITEMS IN THE DICTIONARY IN PYTHON


Write a program, take a dictionary, and print the sum of all the items in the dictionary and display the result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



print()
print("\tSUM OF ALL THE ITEMS IN THE DICTIONARY")
print()
display={'a':10,'b':20,'c':30,'d':40,'e':50}
print("\tDISPLAY RESULT")
print()
print("\tThe total sum is" ,sum(display.values()),".")
print()
print("\tEND OF PROGRAM”)

Remove an Item Using del Statement

In this article, I will show you how to remove items using del in the dictionary in Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



print()
MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}
print("\tDelete an item in the dictionary")
print()
print("\tOriginal Item Dictionary Values")
print("\t",MyFirstDictionary)
print()
print("\tDelete an Item in the Dictionary Values")
del MyFirstDictionary[2]
print("\t",MyFirstDictionary)
print()
print("\tEnd of Program")


Removing Items in the Dictionary in Python

In this article, I will show you how to remove items in the dictionary in Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



print()
MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}
print("\tPop items in the dictionary")
print()
print("\tOriginal Item Dictionary Values")
print("\t",MyFirstDictionary)
print()
print("\tPop Item in the Dictionary Values")
MyFirstDictionary.pop(3)
print("\t",MyFirstDictionary)
print()
print("\tEnd of Program")


Adding Items in the Dictionary in Python


In this article will show how to add items in the dictionary in Python programming.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing

print()
MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}
print("\tAdding new items in the dictionary")
print()
print("\tOriginal Dictionary Values")
print()
print("\t",MyFirstDictionary)
print()
print("\tAdded New Dictionary Values")
MyFirstDictionary[6] = "Golang"
print()
print("\t",MyFirstDictionary)
print()
print("\tEnd of Program")