Question: Write a Python program to identify a number is a prime number or not. Use function to identify whether input number is a prime number
Write a Python program to identify a number is a prime number or not. Use function to identify whether input number is a prime number or not. Ask user to provide a number and your program will output whether it is a prime number or not. After displaying output, ask user whether to continue with another number or quit. Make sure to use the function to identify whether the input is a prime number or not. Main program just invoke the function.
Sample Output
=================================================
Please enter a number: 3 3 is a prime number. Do you want to play again? (Y or N) y Please enter a number: 5 5 is a prime number. Do you want to play again? (Y or N) y Please enter a number: 11 11 is a prime number. Do you want to play again? (Y or N) y Please enter a number: 8 8 is not a prime number. Do you want to play again? (Y or N) y Please enter a number: 10 10 is not a prime number. Do you want to play again? (Y or N) n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
