ARTIFICIAL INTELLIGENCE ASSIGNMENENT
ARTIFICIAL INTELLIGENCE ASSIGNMENENT
ASSIGNMENENT
Q1. Write a program to compute simple interest.
p=int(input("Enter the principal amount"))
r=int(input("Enter the rate of interest"))
t=int(input("Enter the time"))
si=p*r*t/100
print("The si is :",si)
Q9. Write a program to create a list of numbers and find the sum
of the even location elements and the sum of the odd location
elements present in it.
n=int(input("How many numbers you want to enter :"))
m=1
sum1=0
sum2=0
while(m<=n):
x=int(input("Enter a number :"))
if(m%2==0):
sum1=sum1+x
else:
sum2=sum2+x
m=m+1
print("Sum of even numbers is :",sum1)
print("Sum of odd numbers is :",sum2)