1.
CHECKING PRIME NUMBER
#function to check whether the number is prime or not
def check_prime(x ) :
#creating an empty list to store factors of x
factors =[]
#declaring variable count starting with zero
count=0
#iterate from 1 to x
for i in range (1,x+1):
#check if x value is divisible by i
if x%i ==0:
#increment count value by 1
count=count+1
#adding i value to list factors
[Link](i)
#compare whether count value is equal to 2
if count==2:
#if count value is equal to 2 then x is a prime number
print(x, "is a prime number")
else:
#if count value is not equal to 2 then x is not a prime number
print(x, "is not a prime number")
print("factors of " ,x, "is:", *factors )
#asking the user too enter the integer x
x=int(input("Enter an integer (X):"))
#calling the function check_prime and printing results
check_prime(x)
2. EVALUATING AND PRINTING AN EQUATION
#iterate x value from -5 to 5
for x in range(-5,6):
#print equation y
print("When x =", x, "then y=", 8*pow(x,2)+1)