Question
Write a python program that requests a positive integer from the user, determines if it is a prime, composite or neither prime or composite and
Write a python program that requests a positive integer from the user, determines if it is a prime, composite or neither prime or composite and prints the message.
You can choose to use iterative loops to repeatedly run this script or have the user run the script for every input. Please specify instructions to run the code in markdown language above the code cell.
Sample runs are shown below:
Enter positive integer: 3
It is a prime
Enter positive integer: 4
It is a composite
Enter positive integer: 1
It is neither prime nor composite
Enter positive integer: -5
Error: You did not enter a positive integer
Enter positive integer: Hi
Error: You did not enter a positive integer
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