Home /
Expert Answers /
Computer Science /
exercise-2-create-a-python-program-5-marks-write-a-python-program-to-determine-if-a-given-n-pa918
(Solved):
Exercise 2 - Create a Python program [5 marks] Write a python program to determine if a given n ...
Exercise 2 - Create a Python program [5 marks] Write a python program to determine if a given number n is a prime number or not. A prime number is an integer greater than one and is divisible by itself only. You need to check whether n has factors. Factors are numbers that can divide n and leave no reminder. You can carry out this check for each of the numbers which are less than n divided by two. (Hint. Use a for loop) Output: We7come, this program checks whether a number is a prime number. Please enter a number: 5 5 is a prime number. Output: weTcome, this program checks whether a number is a prime number. Please enter a number: 15 15 is not a prime number.