0% found this document useful (0 votes)
3 views19 pages

Python

The document is a practical file for an Artificial Intelligence course, submitted by Raghav Suri. It contains a series of programming exercises aimed at developing skills in basic programming concepts, including calculations, list manipulations, and control structures. Each program is outlined with a brief description and is intended for user input and output demonstration.

Uploaded by

charchitmehra12
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views19 pages

Python

The document is a practical file for an Artificial Intelligence course, submitted by Raghav Suri. It contains a series of programming exercises aimed at developing skills in basic programming concepts, including calculations, list manipulations, and control structures. Each program is outlined with a brief description and is intended for user input and output demonstration.

Uploaded by

charchitmehra12
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like