1.Suppose a dictionary Groceries maps items to
quantities.
Write a python to print the names of the
grocery items whose quantity exceeds 400.
For example, if groceries = {‘cake mixes’:
430, ‘cheese’:312, ‘Orange’:525, ‘candy bars’: 217}
The output will be
Cake mixes
Orange
2. which Python string method would be the best choice to print
the number of time “the” occurs in a sentence entered by the
user?
Provide a one word answer. Just...
How do I make a dictionary in Python language? Can somebody
please provide me with an example code of a Dictionary in Python
Language?
Thank you in advance.
Write code to create a Python dictionary called class.
Add two entries to the dictionary:
Associate the key 'class_name' with the value 'MAT123', and
associate the key 'sect_num' with '211_145'
*Python*
1.1) Create an empty dictionary called 'addresses'.
The dictionary you just created will map names
to addresses. A person's name
(stored as a string) will be the KEY and that
person's address (stored as a string) will be the
VALUE.
1.2) Insert into the dictionary 'addresses' the names and
addresses of two (possibly imaginary) friends of yours.
1.3) Create a second empty dictionary called 'ages'.
The dictionary you just created will map names
to ages. A person's name (stored...
Use Python for this quetions:
Write a python functions that use Dictionary
to:
1) function name it addToDictionary(s,r)
that take a string and add it to a dictionary if the string
exist increment its frequenc
2) function named freq(s,r)
that take a string and a record if the string not exist in the
dictinary it return 0 if it exist it should return its
frequancy.
Using python. 1. How to create a dictionary that has an integer
as a key and a byte as a value? the dictionary keys must contain
integers from 0 to 255. It should be similar to UTF-8. When we
enter an integer, it should return 1 byte. 2. Create a function
when a user gives 1 byte, it should return the key from the
previous dictionary.