Question
this is rquirement for all questions Make sure to validate user input for data type, value range and other problem requirements Print output that
"" this is rquirement for all questions Make sure to validate user input for data type, value range and other problem requirements Print output that clearly explains what is being printed (where necessary) o In other words, dont just print a 5 unless its clear what that 5 represents. Import statements should be immediately after the program docstring Make sure to include # line comments (just a few in each program, dont go crazy) Use snake_case (lower case plus underscores) for variables CONSTANT variables must be all upper case and immediately following any import statements Do NOT use functions for this assignment. Modules Allowed You may only import the following modules into your programs and use their methods and attributes, unless first receiving special (and unlikely) permission from your facilitator: math os re string sy """"
the question is : The following includes concepts taught in Chapter 2 3.1: 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
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started