Page 352 - Artificial Intellegence_v2.0_Class_9
P. 352
S. No. Program
4 To find the sum of two numbers 15 and 20.
N1=15
N2=20
print("The sum of two numbers is :",N1+N2)
Output:
The sum of two numbers is : 35
5 To convert length given in kilometers into meters.
Length=2.5
print("Length given in kilometers is :",Length," kms")
print("Length converted in meters is :",Length*1000," meters")
Output:
Length given in kilometers is : 2.5 kms
Length converted in meters is : 2500.0 meters
6 To print the table of 5 up to five terms.
N=5
print("The table of 5 upto 5 terms are : ")
print(N,"X",1,"=",N*1)
print(N,"X",2,"=",N*2)
print(N,"X",3,"=",N*3)
print(N,"X",4,"=",N*4)
print(N,"X",5,"=",N*5)
Output:
The table of 5 upto 5 terms are:
5 × 1 = 5
5 × 2 = 10
5 × 3 = 15
5 × 4 = 20
5 × 5 = 25
7 To calculate Simple Interest if the principle_amount = 2000 rate_of_interest = 4.5 time = 10
P=2000;R=4.5;T=10
SI=(P*R*T)/100
print("Simple Interest is :",SI)
Output:
Simple Interest is : 900.0
8 To calculate Area and Perimeter of a rectangle
Length=int(input("Enter Length :"))
Breadth=int(input("Enter Breadth :"))
print("Area of Rectangle is :",Length*Breadth)
print("Perimeter of Rectangle is :",2*(Length+Breadth))
Output:
Enter Length : 10
Enter Breadth : 20
Area of Rectangle is : 200
Perimeter of Rectangle is : 60
350 Touchpad Artificial Intelligence (Ver. 2.0)-IX

