Write a Python program that does all the following steps: a. Loops through the integers 2-130...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python program that does all the following steps: a. Loops through the integers 2-130 (inclusive). o Use constants to set the beginning and ending of the range. b. For each integer in the loop, count the number of integers that are: o odd numbers O even numbers o squares of integers o cubes of integers c. When the loop is completed, print output as follows and using the Example below: O A title with the total range evaluated o For Odd and Even counts, print the totals and only the start and end of the range of the numbers in scope with three dots between them. o For Squares and Cubes, print the totals and a list of the numbers that meet the criteria. o Note that none of the numbers being printed should be hard coded. Example of Output: Checking numbers from 2 to 130 Odd (64): 3...129 Even (65): 2...130 Square (10): [4, 9, 16, 25, 36, 49, 64, 81, 100, 121] Cube (4): [8, 27, 64, 125] Notice that 64 is even, a square and a cube. Write a Python program that does all the following steps: a. Loops through the integers 2-130 (inclusive). o Use constants to set the beginning and ending of the range. b. For each integer in the loop, count the number of integers that are: o odd numbers O even numbers o squares of integers o cubes of integers c. When the loop is completed, print output as follows and using the Example below: O A title with the total range evaluated o For Odd and Even counts, print the totals and only the start and end of the range of the numbers in scope with three dots between them. o For Squares and Cubes, print the totals and a list of the numbers that meet the criteria. o Note that none of the numbers being printed should be hard coded. Example of Output: Checking numbers from 2 to 130 Odd (64): 3...129 Even (65): 2...130 Square (10): [4, 9, 16, 25, 36, 49, 64, 81, 100, 121] Cube (4): [8, 27, 64, 125] Notice that 64 is even, a square and a cube.
Expert Answer:
Answer rating: 100% (QA)
Below is a Python program that fulfills the requirements python Constants for the range STA... View the full 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 programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Suppose that the probability that a mechanic fixes a car correctly is 0.9. Determine the odds against the mechanic fixing a car correctly.
-
What would you argue was the single most important decision point for GE and Jack Welch during this time period? How would you describe the decision-making process in that instance? How much of the...
-
Rex Marshall manages a ski resort with year-round and seasonal employees. Assuming that the ski resort engages in interstate commerce, which are the FLSA requirement(s) that Rex should consider? 1....
-
The radiation in the sunlight that gives us feeling of hotness is: (a) Visible radiation (b) Infra-red (c) Red (d) Ultra-violet
-
Terrific Temps fills temporary employment positions for local businesses. Some businesses pay in advance for services; others are billed after services have been performed. Advanced payments are...
-
Calculate the theoretical yield of SnS_2. theoretical yield: 0.768 g The student recovers 0.384 g of SnS_2. Calculate the percent yield of SnS_2 that the student obtained. percent yield: %
-
At Vision Club Company, office workers are employed for a 40-hour workweek on either an annual or a monthly salary basis. Given on the form below are the current annual and monthly salary rates for...
-
Given that vo= 2.4V and R/= 2.3kohm, what is in the figure? V R Vo
-
Red blood cells often can be charged. Two red blood cells are separated by 1.45 m and have an attractive electrostatic force of 0.964 N between them. If one of the red blood cells has a charge of...
-
A small glass marble hanging from a string is charged to +7.0nC. A 4.0 g plastic bead is gently released 4.0 cm beneath the marble. What charge in nC must the plastic bead have to hang suspended in...
-
16 A cook placed five eggs, each having a heat ca- pacity of 114 J/C, in a 250 g aluminum pot con- taining 0.5 L of water at a temperature of 20C. If the heating element is rated at 750 W, and one...
-
The intensity (in W/m) of one sound is 7.21 times as great as the intensity of another sound. Relative to the quieter sound, what is the intensity level 3 of the louder sound?
-
An airplane undergoes the following displacements: First, it flies 294 km in a direction 31.7 east of north. Next, it flies 275 km due south. Finally, it flies 65.5 km 19.8 north of west. How far, d,...
-
(A)Determination of the payback period (2 marks) = The time when the investment reaches break point. (B) Calculation of the Accounting Rate of Return (ARR) Formula and Calculation Accounting Rate of...
-
Evenflow Power Co. is considering a new project that is a little riskier than the current operations of the company. Thus, management has decided to add an additional 1.5% to the company's overall...
-
Clarita is a single taxpayer with two dependent children, ages 10 and 12. Clarita pays $3,000 in qualified child care expenses during the year. If her adjusted gross income (all from wages) for the...
-
Jason and Mary Wells, friends of yours, were married on December 30, 2012. They know you are studying taxes and have come to you with a question concerning their filing status. Jason and Mary would...
-
In 2012, Gale and Cathy Alexander hosted an exchange student, Axel Muller, for 9 months. Axel was part of International Student Exchange Programs (a qualified organization). Axel attended tenth grade...
-
What is the primary business of Satyam Computer Services Ltd?
-
In January 2009, approximately how many employees did Satyam Computer Services employ?
-
How many board members did Ramalinga Raju implicate in the fraud?
Study smarter with the SolutionInn App