Task 12 Suppose you are given the following dictionary where the values are lists. dict = ('A': [1, 2, 3], 'b': ['1', 2], "c": [4, 5, 6, 7]} Write a Python program that counts the total number of items in a dictionary's values and prints it. (without using sum(), len(), count() functions] Note: Make changes to the above dictionary and see if your code works properly for other dictionaries as well. Output:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Downloads/
ID-21201491;NAME-Nuzhat Taba X
+
English
O localhost:8888/notebooks/Downloads/ID-21201491%3BNAME-Nuzhat%20Tabassum%20%3Bsec-17%20%3B%20CSE110%3B%20lab%20assignment%205.ipynb
Cjupyter ID-21201491;NAME-Nuzhat Tabassum ;sec-17 ; CSE110; lab assign... Last Checkpoint: 37 minutes ago (autosaved)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Trusted
Python 3 O
• Run
Code
Task 12
Suppose you are given the following dictionary where the values are lists.
dict = {'A': [1, 2, 3], 'b': ['1', '2'], "c": [4, 5, 6, 7]}
Write a Python program that counts the total number of items in a dictionary's values and prints it.
[without using sum(), len(), count()
ction
Note: Make changes to the above dictionary and see if your code works properly for other dictionaries as well.
=========
============
================
Output:
9.
========:
===D== ==== ===
In [ ]: |
Task 13
Suppose you have been given the following list of tuples.
list %3D[("а", 1), ("Ь", 2), ("а", 3), ("Ь", 1), ("а", 2), ("с", 1)]
Write a Python program that converts this list of tuples into a dictionary and then prints the dictionary.
[You are not allowed to use set]
8:42 PM
a 4)
12/1/2021
Transcribed Image Text:Downloads/ ID-21201491;NAME-Nuzhat Taba X + English O localhost:8888/notebooks/Downloads/ID-21201491%3BNAME-Nuzhat%20Tabassum%20%3Bsec-17%20%3B%20CSE110%3B%20lab%20assignment%205.ipynb Cjupyter ID-21201491;NAME-Nuzhat Tabassum ;sec-17 ; CSE110; lab assign... Last Checkpoint: 37 minutes ago (autosaved) Logout File Edit View Insert Cell Kernel Widgets Help Trusted Python 3 O • Run Code Task 12 Suppose you are given the following dictionary where the values are lists. dict = {'A': [1, 2, 3], 'b': ['1', '2'], "c": [4, 5, 6, 7]} Write a Python program that counts the total number of items in a dictionary's values and prints it. [without using sum(), len(), count() ction Note: Make changes to the above dictionary and see if your code works properly for other dictionaries as well. ========= ============ ================ Output: 9. ========: ===D== ==== === In [ ]: | Task 13 Suppose you have been given the following list of tuples. list %3D[("а", 1), ("Ь", 2), ("а", 3), ("Ь", 1), ("а", 2), ("с", 1)] Write a Python program that converts this list of tuples into a dictionary and then prints the dictionary. [You are not allowed to use set] 8:42 PM a 4) 12/1/2021
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY