ARTIFICIAL INTELLIGENCE
PRACTICAL FILE (417)
SESSION: 25-26
Submitted By:
Raghav Suri
Roll No. 24
X-A
Submitted to:
Ms. Neelam Malhotra
INDEX
Program 1: Write a program to calculate average of 5
numbers entered by user.
Program 2: Write a program to find out the simple
interest, principle, rate & time are entered by user.
Program 3: Write a program to input two numbers and
display the larger of two numbers.
Program 4: Write a program to find out the person is
eligible to vote or not.
Program 5: Write a program to print your name 10 times
using for loop.
Program 6: Write a program to print numbers between
1-10 using loops.
Program 7: Write a program to print sum of numbers 20-
40.
Program 8: Write a program to print odd numbers
between 1 to 20.
Program 9: Write a program to print first 10 natural
numbers.
Program 10: Create a list num= [23,12,5,9,65,44]
a) Print the length of the list.
b) Print the elements from the second to fourth position
using positive indexing.
c) Print the elements from position third to fifth using
negative indexing.
Program 11: Create a list List_1=[10,20,30,40].Add
elements [14,15,12] using extend function.
Program 12: Write a program to find the sum of all
numbers stored in a list.
Program 13: Write a program to take a list of 5 integers:
a) Take a number as input and add it at the end of list.
b) Take a number as input and add it at a given position.
c) Take three numbers as input and add them at the end
of the list.
Program 14: Write a program to take a list of integers as
input:
a) Take an element as input and delete it from list.
b) Take position as input and delete element from that
position in list.
Program 15: Write a program to take a list as input and
display it after sorting it in ascending order.
Program 1: Write a program to
calculate average of 5 numbers
entered by user.
Code:
Output:
Program 2: Write a program to find
out the simple interest, principle, rate
& time are entered by user.
Code:
Output:
Program 3: Write a program to input
two numbers and display the larger of
two numbers.
Code:
Output:
Program 4: Write a program to find
out the person is eligible to vote or
not.
Code:
Output:
Program 5: Write a program to print
your name 10 times using for loop.
Code:
Output:
Program 6: Write a program to print
numbers between 1-10 using loops.
Code:
Output:
Program 7: Write a program to print
sum of numbers 20-40.
Code:
Output:
Program 8: Write a program to print
odd numbers between 1 to 20.
Code:
Output:
Program 9: Write a program to print
first 10 natural numbers.
Code:
Output:
Program 10: Create a list num=
[23,12,5,9,65,44]
a) Print the length of the list.
b) Print the elements from the second to
fourth position using positive indexing.
c) Print the elements from position third to
fifth using negative indexing.
Code:
Output:
Program 11: Create a list
List_1=[10,20,30,40].Add elements
[14,15,12] using extend function.
Code:
Output:
Program 12: Write a program to find
the sum of all numbers stored in a list.
Code:
Output:
Program 13: Write a program to take a list of
5 integers:
a) Take a number as input and add it at the
end of list.
b) Take a number as input and add it at a
given position.
c) Take three numbers as input and add them
at the end of the list.
Code:
Output:
Program 14: Write a program to take a list of
integers as input:
a) Take an element as input and delete it
from list.
b) Take position as input and delete element
from that position in list.
Code:
Output:
Program 15: Write a program to take a
list as input and display it after sorting
it in ascending order.
Code:
Output:
Thank
You