Question: 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
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.
Step by Step Solution
3.40 Rating (144 Votes )
There are 3 Steps involved in it
Below is a Python program that fulfills the requirements python Constants for the range STA... View full answer
Get step-by-step solutions from verified subject matter experts
