Question: Assignment Descript Write a Python program that takes a positive number input from the user: If the number is a prime number, print Number X
Assignment Descript
Write a Python program that takes a positive number input from the user:
If the number is a prime number, print "Number X is PRIME" where is the user input
If the number is NOT a prime number, print "Number X is NOT PRIME" where X is the user input
If the number is negative, your code should print "Number is not allowed" where is the user
Your py file should start like this:
# Your Name
# Your University ID
myNum eval inputEnter a number:
Requirements:
Use myNum as the testing variable.
Check if myNum is a positive number. If not, display an error message.
Use appropriate string concatenation and formatting to display the results neatly no extra space
Example Outputs:
Enter a number:
Number is NOT PRIME
Enter a number:
Number is PRIME
Enter a number:
Number is not allowed
Hints:
A prime number can only be divided by itself and Use the modulus operator to check if the number.
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
