Question: Write a program that will take in any number of integers from a user and output back to the user the same numbers each sorted
Write a program that will take in any number of integers from a user and output back to the user the same numbers each sorted into either an 'prime or an 'non-prime list. Here are the details: - When the program runs a weicome message should be displayed that explains to the user what it is that the program does. - Ask the user to enter any number of integers (a comma-separated list of whole numbers) - For each of the numbers provided into a List (hint: use the string split() method for this part). prime numbers' list (hint: use a loop for this part) Note: A prime number is a number that is divisible only by two numbers itself and one. The factor of a number is a number that can divide it. The list of the first ten prime numbers is 2,3,5,7,11,13,17,23,29,31. A number that is not prime is a composite number. A composite number is a number that can be divided by more than two numbers. Display all odd and all even numbers as two lists of numbers A sample output: prime numbers are 2,3,5,7,11,13,17 non-prime numbers are: 4.6.8,9,12 Hint can use string join() method to join the multiple List items as a comma-separated list of strings, for printing. Or, can use a loop instead, for the same purpose, Either approach is acceptable. - Follow the good coding practices we've discussed. Document the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
