Question: In Python Questions 6.9 and 6.15 236 Dictionaries and Sets that the amount be written unt of the check, its to words as well. Even

In Python
Questions 6.9 and 6.15  In Python Questions 6.9 and 6.15 236 Dictionaries and Sets that
the amount be written unt of the check, its to words as

236 Dictionaries and Sets that the amount be written unt of the check, its to words as well. Even word equivalen, the amount requires that the amount be written in numbers and spelled out in words someone can alter the numerical amount of the check, it's tough to change words. Create a dictionary that maps numbers to their corresponding word Write a script that inputs a numeric check amount that's less than 1000 and tionary to write the word equivalent of the amount. For example, the am should be written as ONE HUNDRED TWELVE AND 43/100 1000 and uses the di Is the amount 112.43 ionary, which mapscount 6.9 (Dictionary Manipulations) Using the following dictionary, which man names to Internet top-level domains (TLDs): tlds - {'Canada': 'ca', 'United States': 'us'. "Mexico': 'x') perform the following tasks and display the results: a) Check whether the dictionary contains the key 'Canada'. b) Check whether the dictionary contains the key 'France'. c) Iterate through the key-value pairs and display them in two-column forma d) Add the key-value pair Sweden' and 'sw' (which is incorrect). c) Update the value for the key 'Sweden' to 'se'. f Use a dictionary comprehension to reverse the keys and values. With the result of part (1), use a dictionary comprehension to convert the coun- try names to all uppercase letters. 6.10 (Set Manipulations Using the following sets: {'red'. 'green', 'blue' } {'cyan'. 'green', 'blue'. 'magenta', 'red') display the results of: a) comparing the sets using the cach of the comparison operators. b) combining the sets using cach of the mathematical ser operators. 6.11 (Analyzing the Game of Craps) Modify the script of Fig. 4.2 to play 1,000,000 games of craps. Use a wins dictionary to keep track of the number of games won for a par- ticular number of rolls. Similarly, use a losses dictionary to keep track of the number of games lost for a particular number of rolls. As the simulation proceeds, keep updating the dictionaries. A typical key-value pair in the wins dictionary might be 4: 50217 indicating that 50217 games were won on the 4th roll. Display a summary of the results including a) the percentage of the total games played that were won. b) the percentage of the total games played that were lost. c) the percentages of the total games played that were won or lost on a given (column 2 of the sample output). d) the cumulative percentage of the total games played that were won or lost up and including a given number of rolls (column 3 of the sample output) Exercises 237 sens ut in Your output should be similar to the one below. lemts. ne dic- 12.43 Juntty Percentage of winst 50.2 Percentage of losses! 49. centage of wins/losses based on total number of rolls Resolved Cumulative on this roll Dolls of games resolved 30.10% 30.10% 20.80 50.90K 14,10% 65.OOX 9.90% 74.90x 7.40% 82. 30% 4.60% 86.90% 90.60 3.70% 2.40K 93.00% 1.90% 94.90% 1. 10 96.00% 0.90% 96.90% 0.80% 97.70% 0.80X 98.50% 0.30% 98.80% 0.30% 99.10% 0.30% 99.40X 0.50% 99.90% 0.10% 100.00% mar. coun- 000,000 or a par- mber of 6.12 (Translation Dictionary) Use an online translation tool such as Bing Microsoft Translator or Google Translate to translate English words to another language. Create a translations dictionary that maps the English words to their translations. Display a two- column table of translations. 6.13 (Synonyms Dictionary) Use an online thesaurus to look up synonyms for five words, then create a synonyms dictionary that maps those words to lists containing three synonyms for each word. Display the dictionary's contents as a key with an indented list of synonyms below it. 6.14 (Intro to Data Science: Dynamic Visualization of Coin Tossing Modify your coin- tossing simulation from Exercise 5.31 to update the bar plot dynamically as you flip the coin. Use the techniques you learned in Section 6.4.2. 6.15 (Intro to Data Science: Dynamic Visualization of Rolling To Dice) Modify your simulation of rolling two dice from Exercise 5.32 to update the bar plor dynamically as you roll the dice. Use the techniques you learned in Section 6.4.2. 6.16 (Intro to Data Science: Dynamic Visualization of the Dice Game of Craps) Reim- plement your solution to Exercise 5.33, using the techniques you learned in Section 6.4.2 to create a dynamic bar chart showing the wins and losses on the first roll, second roll, third roll, etc. 6.17 (Project: Cooking with Healthier Ingredients) in the "Strings: A Deeper Look" chapter's exercises, you'll write a script that enables its user to enter ingredients from a cooking recipe, then recommends healthier replacements. In preparation for that exer- cise, create a dictionary that maps ingredients to lists of potential replacements. Some in- gredient replacements are shown below: ting the me results given roll ost up to 3. Always consult a healthcare professional before making significant changes to your diet

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!