Practical File Class 9
Practical File Class 9
ARTIFICIAL INTELLIGENCE
PRACTICAL FILE
SESSION: 2024-25
Roll no : 20
Class : IX-A
12. Program to print odd numbers from 1 to 100 in reverse order using for loop.
2.
Program to convert length given in
kilometers into meters.
Input:
kilometres = float(input('Enter length in
kilometres: '))
meters = kilometres * 1000
print('Length in meters:', meters)
Output:
3. Program to calculate simple interest if
the Principle Amount = 2000, Rate of
interest = 4.5 and Time = 10.
Input:
p = 2000
r = 4.5
t = 10
si = (P * R * T) / 100
print("The Principle Amount is rs.", p)
print("The Rate of Interest per annum is", r, "%")
print("The Time is", 10, "years")
print("The Simple Interest is rs.", si)
Output:
4. Program to calculate the area and
perimeter of a rectangle.
Input:
length = float(input('Enter length of rectangle: '))
breadth = float(input('Enter breadth of
rectangle:'))
area = length * breadth
perimeter = 2 * (length + breadth)
print('Area:', area)
print('Perimeter:', perimeter)
Output:
Output:
11. Program to print characters of your
name.
Input:
name = str(input('Enter Your Name: '))
for char in name:
print(char)
Output:
12. Program to print odd numbers from 1 to
100 in reverse order using for loop.
from 1 to 100.
Input:
sum_odd = 0
for num in range(1, 101, 2):
sum_odd += num
print('Sum of odd numbers:', sum_odd)
Output:
16.