print("program to BUILT-IN methods of list \n") animals=['cat','dog','rabbit'] animals.append('cow') print("updated animals list:",animals) language=['python','java','c++','c'] return_value=language.pop(3) print("updated list:",language) vowels=['e','a','o','u','i'] vowels.sort() print("sorted list in asending:",vowels) vowels.sort(reverse=True) print("sorted list in desending:",vowels) vowels=['a','e','i','o','u'] print("updated list:",vowels) vowels.insert(3,'o') animals=['cat','dog','rabbit','pig'] animals.remove("rabbit") print("updated list:",animals) os=['window','MACos','Linux'] print("original list:",os) os.reverse() print("update dlist:",os) thisdict={"NAME":"Vishal","PLACE":"Sankeshwar","USN":1773245} print("\n Dictionary content:",thisdict) x=thisdict["PLACE"] print("PLACE:",x) print("\n keys in the dictionary are:",thisdict) for x in thisdict: print(x) print("\n values in the dictionary are:",thisdict) for x in thisdict: print(thisdict[x]) print("\n both keys and values in the dictionary are:",thisdict) for x,y in thisdict.items(): print(x,y) print("\n total items i the dictionary are:",thisdict) thisdict["DISTRICT"]="Belagavi" print("\n added new items is:",thisdict) thisdict.pop("PLACE") print("\n after removing the items is:",thisdict) del thisdict["USN"] print("\n after deleting the items is:",thisdict) thisdict.clear() print("\n empty dictionary:",thisdict) thisdict={"NAME":"vishal","PLACE":"Sankeshwar","USN":177245} mydict=thisdict.copy() print("updated list:",mydict) import sqlite3 conn=sqlite3.connect('test.db') cursor=conn.cursor() cursor.execute("create table emp3(id integer,name tect)") cursor.execute("\n insert into emp3(id,name)values(101,'ravi')") cursor.execute("\n insert into emp3(id,name)values(102,'raju')") cursor.execute("\n insert into emp3(id,name)values(103,'ramesh')") print("\n displayng the table") cursor.execute("select *from emp3") rows=cursor.fetchall() for row in rows: print(row) print("\n after update and delete records in the table table") cursor.execute("\n update emp3 set name='rakesh' where id=101") cursor.execute("\n delete from emp3 where id=103") print("\n displayng the table") cursor.execute("select *from emp3") rows=cursor.fetchall() for row in rows: print(row) print("\n table is droped...") cursor.execute("drop table emp3") conn.commit() cursor.close() conn.close() import tkinter as tk window=tk.Tk() window=title("MY GUI") label=tk.label(window,text="This is example for label") label.pack() button=tk.Button(window,text="Click me") button.pack() chk1=tk.Checkbutton(window,text="python") chk2=tk.Checkbutton(window,text="java") chk1.pack() chk2.pack() entry=tk.Entry(window,text="") entry.pack() window.mainloop() try: print("TRY BLOCK") a=int((input("Enter a:"))) b=int((input)"Enter b:"))) c=a/b Except: print("EXCEPT BLOCK") print("we cannot divide by zero") else: print("ELSE BLOCK") print("The division of a and b is:",c) print("NO EXCEPTION") Finally: print("FINALLY BLOCK") print("out of except,else and finally block:") import matplotlib.pyplot as plt x=[1,2,3,4,5] y=[3,2,4,1,5] plt.plot(x,y) plt.xlabel('x-axis label') plt.ylabel('y-axis label') plt.title('line chart example') plt.show import matplotlib.pyplot as plt x=['a','b','c','d'] y=[3,7,2,5,9] plt.bar(x,y) plt.xlabel('x-axis label') plt.ylabel('y-axis label') plt.title('vertical bar chart example') plt.show import matplotlib.pyplot as mlt student_performance=["excellent','good','average','poor'] student_values=[15,20,40,10] mlt.subplot(1,2,1) mlt.pie(student_values,labels=student_performance,startangle=90,explode=[0.2,0.1,0,0],shadow=True,colors=["violet","indigo","blue","orange"]) marks=[90,92,40,0,55,44,30,20,10,54,74,82] grade_interval=[0,35,70,100] mlt.subplot(1,2,2) mlt.title("....STUDENT....GRADE....") mlt.hist(marks,grade_interval,facecolor="cyan",rwidth=0.7,histtype="bar") mlt.xticks([0,35,70,100]) mlt.xlabel("P E R C E N T A G E") mlt.ylabel("No.of STUDENTS....") mlt.show()