1. Using a for loop, write a program that prints out the decimal equivalents of 1/2,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Using a for loop, write a program that prints out the decimal equivalents of 1/2, 1/3, 1/4,.... 1/10. 2. Create a for loop script with exactly 2 lines of code that generate a sequence of integer numbers starting from 2 up to (and including) 26 incremented by 2 (look up the range() function). Expected output: Generated number: 2 Generated number: 4 Generated number: 6 Generated number: 8 Generated number: 10 Generated number: 12 Generated number: 14 Generated number: 16 Generated number: 18 Generated number: 20 Generated number: 22 Generated number: 24 Generated number: 26 3. Complete the following code block to calculate the sum of all the integer multipliers of 11 between (and including) the number o and up to (not including) the number 10, i.e., 0 x 11+0=0 1 x 11.0-11 2 x 11+ 11 = 33 3 x 11+33-66 7 x 11 +231 = 308 8 x 11+308-396 9 11 +396 - 495 Here is a code template: 1 = 0 sum11 = 9 while j < 10: ### Place your code below this line ### ### Place your code above this line ### print('') print('Total sumll is:', sum11) Here is a code template: j = 0 sum11 = 9 while j < 10: ### Place your code below this line ### ### Place your code above this line ### print('') print('Total sumll is:', sum11) Expected output: 0 sum11: 0 j: 1 sum11: 11 j: 2 sum11: 33 j: 3 sum11: 66 j: 4 sum11: 110 j: 5 sum11: 165 j: 6 sum11: 231 j: 7 sum11: 308 j: 8 sum11: 396 j: 9 sum11: 495 Total sum11 is: 495 Exercise 4 - Encoding & Decoding You are analyzing an unstructured text dataset that contains a cluster of comments by 31 million fans on an online soccer forum about the 2018 FIFA World Cup (host nation is Russia). Using market research, the cluster of comments has been summarized into a single representative comment and provided to you in a file using the Python byte native format as follows (for your convenience, the message is: b'\xd0\x9f\xd0\xb5\xd1\x80\xd1\x83 \xd0\xbf\xd0\xbe\xd0\xb1\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x82!'): b'\xd0\x9f\xd0\xb5\xd1\x80\xd1\x83 \xd0\xbf\xd0\xbe\xd0\xb1\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x82! You need to decode the above message to Russian to create a report for your consulting project. Then, you need to copy and paste the Russian characters for this message into Google Translate (https://translate.google.com/) in order to translate the comment into English. Can you find out what the message says in English? Write your answer as a Python comment statement. Hint: Create a variable name and assign its value as the Python byte format message. Then use the decode() function using Unicode format as seen in class lectures. You can then follow the remaining instructions in this question to arrive at the correct English translation. How do you know you got it right? The correct answer contains three English words (written in English) and one exclamation point. 1. Using a for loop, write a program that prints out the decimal equivalents of 1/2, 1/3, 1/4,.... 1/10. 2. Create a for loop script with exactly 2 lines of code that generate a sequence of integer numbers starting from 2 up to (and including) 26 incremented by 2 (look up the range() function). Expected output: Generated number: 2 Generated number: 4 Generated number: 6 Generated number: 8 Generated number: 10 Generated number: 12 Generated number: 14 Generated number: 16 Generated number: 18 Generated number: 20 Generated number: 22 Generated number: 24 Generated number: 26 3. Complete the following code block to calculate the sum of all the integer multipliers of 11 between (and including) the number o and up to (not including) the number 10, i.e., 0 x 11+0=0 1 x 11.0-11 2 x 11+ 11 = 33 3 x 11+33-66 7 x 11 +231 = 308 8 x 11+308-396 9 11 +396 - 495 Here is a code template: 1 = 0 sum11 = 9 while j < 10: ### Place your code below this line ### ### Place your code above this line ### print('') print('Total sumll is:', sum11) Here is a code template: j = 0 sum11 = 9 while j < 10: ### Place your code below this line ### ### Place your code above this line ### print('') print('Total sumll is:', sum11) Expected output: 0 sum11: 0 j: 1 sum11: 11 j: 2 sum11: 33 j: 3 sum11: 66 j: 4 sum11: 110 j: 5 sum11: 165 j: 6 sum11: 231 j: 7 sum11: 308 j: 8 sum11: 396 j: 9 sum11: 495 Total sum11 is: 495 Exercise 4 - Encoding & Decoding You are analyzing an unstructured text dataset that contains a cluster of comments by 31 million fans on an online soccer forum about the 2018 FIFA World Cup (host nation is Russia). Using market research, the cluster of comments has been summarized into a single representative comment and provided to you in a file using the Python byte native format as follows (for your convenience, the message is: b'\xd0\x9f\xd0\xb5\xd1\x80\xd1\x83 \xd0\xbf\xd0\xbe\xd0\xb1\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x82!'): b'\xd0\x9f\xd0\xb5\xd1\x80\xd1\x83 \xd0\xbf\xd0\xbe\xd0\xb1\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x82! You need to decode the above message to Russian to create a report for your consulting project. Then, you need to copy and paste the Russian characters for this message into Google Translate (https://translate.google.com/) in order to translate the comment into English. Can you find out what the message says in English? Write your answer as a Python comment statement. Hint: Create a variable name and assign its value as the Python byte format message. Then use the decode() function using Unicode format as seen in class lectures. You can then follow the remaining instructions in this question to arrive at the correct English translation. How do you know you got it right? The correct answer contains three English words (written in English) and one exclamation point.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these algorithms questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
On the income statement for the year ending December 31, Y1, the accountant for ABC calculated operating income before taxes of $300,000. This $300,000 did not include the effect of any of the...
-
If you were the CEO of a Retail Chain of stores, what are the factors you would consider in choosing ( selecting ) an ERM / CRM Package software. Evaluate the existing packages available in the...
-
Figure shows two isotropic point sources of sound, S1 and S2. The sources emit waves in phase at wavelength 0.50 m; they are separated by D = 1.75 m. If we move a sound detector along a large circle...
-
A balloon is filled with helium gas to a pressure of \(107 \mathrm{kPa}\) when the temperature is \(295 \mathrm{~K}\). If the temperature changes to \(318 \mathrm{~K}\), what will be the pressure of...
-
a. At a product price of $56, will this firm produce in the short run? Why or why not? If it is preferable to produce, what will be the profit-maximizing or loss-minimizing output? Explain. What...
-
i need help with this question with an explanation thanks! 7) Large Co. pays its employees $20,000 gross salary each week. 30% of salary is withheld for income taxes and 5% is withheld to pay Social...
-
A company has a policy of retiring company cars this policy looks at number of miles driven, purpose of trips, style of car and other features The distribution of the number of months in service for...
-
Joe is 25 and has a wage of $30,000. He is single with no dependents, and files as single. He rents and makes no contributions to charity. He contributed $800 to a Roth IRA in 2022. What is his Total...
-
Thinking back to how you made the decision about which college or university to attend to what extent do you think you were impacted by the decision-making biases?
-
Strengths What your business will do well, along with any unique assets, resources, capabilities, and/or accomplishments. Example questions to answer: What do you excel at? What are you most proud...
-
An imaginary Canadian cell phone company would want to examine to determine if there is potential to sell their products in India and USA? How the marketing will be done internationally?
-
Read the scenario below and answer ALL the questions that follow Company X is a well-established company operating in South Africa, known for its diverse workforce. However, it has a company policy...
-
Presented below are data for Blossom Company 2020 2021 Assets, January 1 $8840 $9710 Liabilities, January 1 4850 ? Stockholders' Equity, Jan. 1 Dividends 1610 1205 Common Stock 1448 1286...
-
Describe a group you belong or have belonged discuss the stages of group development and suggest how to improve the group effectiveness by using the group development model.
-
Sally hires a maid to work in her home for $250 per month. The maid is 25 years old and not related to Sally. During 2012, the maid worked 10 months for Sally. a. What is the amount of Social...
-
Larry Gaines, age 42, sells his personal residence on November 12, 2012, for $144,000. He lived in the house for 7 years. The expenses of the sale are $10,500, and he has made capital improvements of...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1 and 2. On September 1, Irene opened a retail store that specializes in sports car...
-
Initially, both legs of a mercury manometer are open to the atmosphere, and the mercury height in the left leg is \(40.0 \mathrm{~mm}\). You inflate a balloon until it has a surface area of \(0.300...
-
At an atmospheric pressure of \(1.00 \mathrm{~atm}\), the height of the liquid in the tube of a mercury barometer is \(760 \mathrm{~mm}\) only if you ignore capillary rise in the tube. Obtain an...
-
A hydrogen-filled balloon is used to lift a \(125-\mathrm{kg}\) stone off the ground. The basket holding the stone has a mass of \(15.0 \mathrm{~kg}\). What must the minimum radius \(R\) of the...
Study smarter with the SolutionInn App