Question: this should be done in python programming language Problem 1 (Divisors and Prime Numbers) a) Write a program that uses a while loop to print


Problem 1 (Divisors and Prime Numbers) a) Write a program that uses a while loop to print all divisors of a number supplied by the user. The program should also print the sum of all the divisors and whether the number the user entered is a prime number or not. Note: The definition of a divisor is a number that divides another evenly (i.e., without a remainder) and the definition of a prime number is a number whose only divisors are 1 and itself. b) Implement the same program as above using a for loop instead of a while loop. Which implementation do you think is the better choice for this rahlomo nie Problem 2 (Calculate statistics) Write a program that repeatedly reads integers from the user until the user enters the word 'stop' (this is called a sentinel value). When the user enters the sentinel value, output the following statistics about the sequence of integers: sum, average, sum of even numbers, and the largest number. Problem 3 (Number of Digits) Write a program that asks the user to enter an integer, then prints the number of digits in the integer. You should not use the len() command/function to get the length of the string. Hint: think about counting how many times you can move the decimal point (i.. divide by 10)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
