Python Programs
Python Programs
AIM:
To create a list in python of children selected for science quiz with the following names
Arjun, Sonakshi, Vikram, Sandhya, Sonal, Isha, Karthick and perform the following tasks on
the list in sequence:
a) Print the whole list.
b) Delete the name “Vikram” from the list.
c) Add the name “Jaya” at the end.
d) Remove the item which is at the second position.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 14
AIM:
To create a list num = [23,12,5,9,65,44]
a) Print the length of the list.
b) Print the elements from second to fourth position using positive indexing.
c) Print the elements from position third to fifth using negative indexing.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 15
AIM:
To create a list of first 10 even numbers, add 1 to each list item and print the final list.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 16
AIM:
To create a list List_1=[10,20,30,30]. Add the elements [14,15,12] using extend function.
Now sort the final list in ascending order and print it.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 17
AIM:
To create a program to check if a person can vote.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 18
AIM:
To create a program to check the grade of a student.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 19
AIM:
To create a program to check if the number is positive, negative or zero and display an
appropriate message.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 20
AIM:
To print first ten natural numbers.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 21
AIM:
To print first ten even numbers.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 22
AIM:
To print odd numbers from 1 to n
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 23
AIM:
To print sum of first 10 natural numbers.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.
Program 24
AIM:
To create a program to find the sum of all numbers stored in a list.
PROGRAM:
OUTPUT:
RESULT:
The program was executed successfully.