Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE solve using python thank you a. Ask the user to enter an integer between 5 and 15 and save the value entered by the
PLEASE solve using python thank you
a. Ask the user to enter an integer between 5 and 15 and save the value entered by the user as an int called myint. You may assume that the user will enter an integer, but it may not be in the proper range. b. Check if myint is in the proper range, and if so, so the following: i. Create a loop that calculates the sum of all the integers from 1 to myint (inclusive). The sum should be stored in a variable called mysum, which is updated in each iteration. For example, if the user enters 7 , the final value of mysum should be mysum =1+2+3+4+5+6+7=28 ii. After exiting from the loop, print the value of mysum, with a suitable message. c. Otherwise (i.e., myint is not in the proper range), print a message indicating that the input was invalid
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