Question: Write a Python program, in a file called processkunbers.py, which, given an integer value n (between 6 and 12 inclusive), computes and outputs the following
Write a Python program, in a file called processkunbers.py, which, given an integer value n (between 6 and 12 inclusive), computes and outputs the following (using functions as described below): the sum of the numbers from 1 to n, inclusive . all the divisors except for 1 and the number itself, of the sum returned by the first part (the sum from 1 to n) Your program should include the following functions: a. A boolean function shouldprocess that returns true if the given number n is between 6 and 12 inclusive, otherwise it returns false. b. A function called processInput which uses shouldProcess to determine if it can compute and output (only if function shouldProcess returns true) the sum and divisors as described above. If it can process the input, it should also use the following functions: o FindSum which computes and returns the sum of the numbers from 1 to n findDivisors which finds and prints all the divisors of the sum (except for 1 and the sum itself) computed by the function is If processinput should not process the input, then it should show a message indicating this. All output should be appropriately labelled C. A main function to get the integer value and call the processing function. For example, if the given input is 10, then the input prompt, input and output should be as follows (input shown in blue): Please enter an integer between 6 and 12, inclusive: 1 The sus from 1 to 18 is: 55 The divisors of 55 are: 5 11 or, if the given input is 4, then the input prompt, input and output should be as follows: Please enter an integer between 6 and 12, inclusive: 4 The number 4 is outside of the acceptable range
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
