Question: The assignment is another exercise in using a particular language feature, loops in Python.The intention is that you practice writing code with the small tasks.
The assignment is another exercise in using a particular language feature, loops in Python.The intention is that you practice writing code with the small tasks. If you copy from other people you are only depriving yourself of an education. To learn, you have to think it through, yourself. Finding a solution online and copying it is easy, but leaves you facing the problem of learning what you were supposed to learn, in the context of a much harder problem the next time.To practice writing loops, create a method called forwhileloopfirstname instead of main. Write The following loops within the forwhileloopfirstname of the same py program and not as functions. All the loops have to be written using a for loop or a while loop. Turn in this assignment with comments and a header as a zip or rar folder as usual that contains only the source code.Write main program called forwhileloopfirstname instead of main which should include the following five loops Write a while loop that counts from down to printing the count value each time in the loop. The output should be on two lines as shown below with first numbers on the first line and the next numbers on the second line notice the spacing and a period at the end: Use a variable countfirstname to count the numbers and once this count reaches remaining numbers are printed on the next line.Call this loop within forwhileloopfirstname Write a for loop that prints all multiples of between and printing the count in each iteration but omitting numbers that are divisible Use continue to omit the numbers divisible by The output should look likeNote that and are omitted as they are divisible by Notice the commas in between. Notice that there is no comma at the beginning or end. That means that you must do something special either at the beginning or at the end Write a loop to validate the input entered. Ask the user to enter an integer greater than or equal to and less than Loop should be repeated as long as an invalid number is entered. If a valid input is entered, should print Good Job, Firstname. Please use your first name.So for example if the user enters loop should say Invalid Input. Please enter a number between and both numbers included.If user enters program should say Good Job, Firstname Ask the user to input an integer parameter The loop should count down only the even numbers, starting with the input number and ending with the negative of the input number if input is even. If input is odd start with the even number greater than the input and ending with the even number greater than the negative of the input number For this you should use a while loop. The numbers should all appear on the same line.So for example if the input number passed is an even number the output should beSo for example if the input number passed is an odd number the output should be Ask the user to input an integer parameter. The loop should find the sum of all the positive odd numbers below the number, starting with the number and up to the number that was passed as the input parameter. For this you should use a for loop. So for example if the number passed in using input is the output should beSum of all odd numbers below is This will be You do not need to show the calculation.So for example if the number passed in using input is the output should beSum of all odd numbers below is This will be You do not need to show the calculation. Name the file also as forwhileloopfirstname.py with the loops function, do all these loops within the forwhileloopfirstname function. Do not submit different programs. Use your first name wherever first name is mentioned.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
