Final Practical File - To Upload
Final Practical File - To Upload
8. Python program to print a whole list, add, delete and remove a student name.
mylist=["Anu","Banu","Hema"]
print(mylist)
mylist.append("Balu")
print("List after after append:")
print(mylist)
mylist =["Anu","Banu","Hema","Balu"]
mylist.remove("Anu")
print("List after removing an element:")
print(mylist)
mylist=["Anu”,”Banu","Hema"]
mylist.pop(0)
print(mylist)
9. Create a list of 10 numbers and perform the following few tasks:
mylist=[23,45,34,46,7,3,78,9,34,15]
print(len(mylist))
mylist=[23,45,34,46,7,3,78,9,34,15]
print(mylist[2:5])
mylist=[23,45,34,46,7,3,78,9,34,15]
print(mylist[-5:-2])
mylist=[23,45,34,46,7,3,78,9,34,15]
mylist.sort()
print(mylist)
10. Python program to add the elements of two lists.
List1=[1,2,3]
List2=[2,4,6]
List3=[]
print("List1 value",List1)
print("List2 value",List2)
for i in range(0,len(List1)):
List3.append(List1[i]+List2[i])
print("Sum of two lists",List3)
14. Python program to read csv file saved in our system and display its information.
import pandas as pd
dataset = pd.read_csv(r'C:\Users\Administrator\Desktop\trial.csv')
print(dataset)
15. Python program to read an image, display and identify its shape using Python.