Shaumya Final Report
Shaumya Final Report
On
PYTHON PROGRAMMING
In partial fulfillment of requirements for the degree
Of
Bachelor of Technology
In
Computer Science & Engineering
(Artificial Intelligence and Machine Learning)
Submitted By:
Mr. Shaumya Srivastava
Roll Number: 2301331530155
B. Tech CSE(AIML) 2nd Year
(Approved by AICTE and affiliated to Dr. A.P.J. Abdul Kalam Technical University, Uttar
Pradesh, Lucknow)
2024
i
CERTIFICATE
I hereby certify that the work which is being submitted in the Project Report entitled
“CORE Python” in partial fulfillment of the requirements for the award of the Bachelor of
Technology in Computer Science and Engineering Artificial Intelligence Machine
Learning and submitted to the Department of Computer Science & Engineering Artificial
Intelligence, Noida Institute of Engineering & Technology, Greater Noida is an
authentic record of my Internship carried out during Third semester under the supervision of
Ms.Shweta, Department of Computer Science and Engineering Artificial Intelligence
Machine Learning, Noida Institute of Engineering & Technology, Greater Noida. The
matter embodied in this project Report is original and has not been submitted for the award
of any other degree or diploma.
Shaumya Srivastava
This is to certify the above statement made by the candidate is correct and true to the
best of my knowledge.
ii
DECLARATION
I hereby declare that this submission is my own project and that, to the best of
my own knowledge and belief, it contains no material previously published by
another person nor material which to a substantial extent has been accepted for
the award of any other degree or diploma of the university or other institute of
higher learning except where due acknowledgement has been made in the text.
Signature of Candidate
iii
ACKNOWLEDGEMENT
Shaumya Srivastava
iv
Table of the Contents:
TITLE Pg No.
S. No.
1. Certificate ii.
2. Declaration iii.
3. Acknowledgement iv
4. Internship Certificate 6
5. Internship Platform 7
5. About Python 8
6. History of Python 9
7. Advantages of Python 10
11. Conclusion 21
12. References 22
5
INTERNSHIP
CERTIFICATE
6
INTERNSHIP PLATFORM
The purpose of this presentation is to provide a detailed account of my
internship experience at “CODSOFT”. A 4 weeks course of complete Python.
The training consisted of Introduction to Python, Using Variables in
Python,Basics of Programming in Python,Principles of ObjectOriented
Programing,Developing a GUI,Application of Python in Various Disciplines.
They are passionate about technology and believe in the power of software to
transform the world. Their internship program is just one of the ways in which
they are investing in the future of the industry.
7
ABOUT PYTHON
Debugging Python programs is easy: a bug or bad input will never cause a
segmentation fault. Instead, when the interpreter discovers an error, it raises an
exception. When the program doesn't catch the exception, the interpreter prints
a stack trace. A source level debugger allows inspection of local and global
variables, evaluation of arbitrary
8
HISTORY OF PYTHON
The programming language Python was conceived in the late 1980s, and its
implementation was started in December 1989 by Guido van Rossum at CWI
in the Netherlands as a successor to ABC capable of exception handling and
interfacing with the Amoeba operating system. Pl Van Rossum is Python's
principal author, and his continuing central role in deciding the direction of
Python is reflected in the title given to him by the Python community,
Benevolent Dictator for Life (BDFL). (However, Van Rossum stepped down
as leader on July 12, 2018.). Python was named after the BBCTVshow
Monty Python's Flying Circus.
Python 2.0 was released on October 16, 2000, with many major new features,
including a cycle-detecting garbage collector (in addition to reference
counting) for memory management and support for Unicode. However, the
most important change was to the development process itself, with a shift to a
more transparent and community-backedprocess.
9
ADVANTAGES OF PYTHON
10
PROJECT CODE 1
PASSWORD GENERATOR
from tkinter import *
tk.geometry('300x300')
tk.configure(background='pink')
password=StringVar()
pas=IntVar()
pas.set('Enter Length')
password_generator():
characters='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
UVWXYZ1234567890 !@#$%^&*()'
Password=''
if pas.get()>=8:
for i in range(pas.get()):
Password+=random.choice(characters)
password.set(Password)
copyclipboard():
random_password = password.get()
pyperclip.copy(random_password)
11
Label(tk,text="Copied to Clipboard",bg="red").pack(pady=6)
Entry(tk, textvariable=pas).pack(pady=3)
Entry(tk, textvariable=password).pack(pady=3)
tk.mainloop()
OUTPUT
12
PROJECT CODE 2
CALCULATOR
root=Tk()
root.title("Simple Calculator")
mainframe=Frame(root,width=45,bd=10,relief=RIDGE,bg="blue")
mainframe.pack()
inner=Frame(mainframe,width=45,bd=10,relief=RIDGE,bg="black")inner.pack()
e=Entry(inner,width=65,borderwidth=5)
e.grid(row=0,column=0,columnspan=4,padx=10,pady=1)def
onclick(num):
x=e.get()
e.delete(0,END)
e.insert(0,str(x)+str(num))
def clear():
e.delete(0,END)
def add():
global first,op
op="+"
first=e.get()
13
e.delete(0,END)
def sub():
global
first,op op='-'
first=e.get()
e.delete(0,END)
def mul():
global first,op
op='*'
first=e.get()
e.delete(0,END)
def div():
global first,op
op='/'
first=e.get()
e.delete(0,END)
def equal():
second=e.get()
if op=='+':
result=float(first)+float(second)
elif op=='-':
result=float(first)-float(second)
elif op=='*':
result=float(first)*float(second)
14
elif op=='/':
result=float(first)/float(second)
e.delete(0,END)
e.insert(0,result)
#############################################
####Button widget####
button_1=Button(inner,text="1",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(1))
button_2=Button(inner,text="2",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(2))
button_3=Button(inner,text="3",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(3))
button_4=Button(inner,text="4",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(4))
button_5=Button(inner,text="5",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(5))
button_6=Button(inner,text="6",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(6))
button_7=Button(inner,text="7",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(7))
button_8=Button(inner,text="8",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(8))
button_9=Button(inner,text="9",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(9))
button_0=Button(inner,text="0",padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=lambda:onclick(0))#
operation button
15
button_add=Button(inner,text='+',padx=30,pady=10,relief=RIDGE,font=1
5,width=4,command=add)
button_sub=Button(inner,text='-
',padx=30,pady=10,relief=RIDGE,font=15,width=4,command=sub)
button_mul=Button(inner,text='*',padx=30,pady=10,relief=RIDGE,font=1
5,width=4,command=mul)
button_div=Button(inner,text='/',padx=30,pady=10,relief=RIDGE,font=15
,width=4,command=div)
button_equal=Button(inner,text='=',padx=30,pady=10,relief=RIDGE,font
=15,width=4,command=equal)
button_clear=Button(inner,text='C',padx=30,pady=10,relief=RIDGE,font
=15,width=4,command=clear)
button_1.grid(row=3,column=0)
button_2.grid(row=3,column=1)
button_3.grid(row=3,column=2)
button_4.grid(row=2,column=0)
button_5.grid(row=2,column=1)
button_6.grid(row=2,column=2)
button_7.grid(row=1,column=0)
button_8.grid(row=1,column=1)
button_9.grid(row=1,column=2)
button_0.grid(row=4,column=0)
16
button_add.grid(row=1,column=3)
button_sub.grid(row=2,column=3)
button_mul.grid(row=3,column=3)
button_div.grid(row=4,column=3)
button_equal.grid(row=4,column=2)
button_clear.grid(row=4,column=1)
root.mainloop()
OUTPUT
17
PROJECT CODE 3
TO DO LIST
#importing modules
#create functions
def newtask():
task=my_entry.get()
if task !="":
lb.insert(END,task)
my_entry.delete(0,"end")
else:
deleteTask():
lb.delete(ANCHOR)
ws=Tk()
ws.geometry("750x550")
ws.title("TO DO LIST")
ws.config(bg="#223441")
# creating widgets
18
frame=Frame(ws)
frame.pack(pady=10)
lb=Listbox(frame,width=25,height=8,font=("Times",18),bd=0,fg='#464646
',selectbackground='#a6a6a6',activestyle=None)
lb.pack(side=LEFT,fill=BOTH) task_list=['WAKE
UP','DRINK WATER','HAVE
BATH','MEDITATE','WRITE JOURNAL','MAKE
NOTES','BREAKFAST','GO OUT']
lb.insert(END,item)
sb=Scrollbar(frame)
sb.pack(side=RIGHT,fill=BOTH)
lb.config(yscrollcommand=sb.set)
sb.config(command=lb.yview)
my_entry=Entry(ws,font=('times',20))
my_entry.pack(pady=20)
buttonframe=Frame(ws)
buttonframe.pack(pady=20)
add_task=Button(buttonframe,text="Add
Task",font=('times',14),bg="green",padx=20,pady=10,command=newtask
)
add_task.pack(fill=BOTH,expand=True,side=LEFT)#deleting
a task button
del_task=Button(buttonframe,text="Delete a
Task",font=('times',14),bg="yellow",padx=20,pady=10,command=deleteT ask)
19
del_task.pack(fill=BOTH,expand=True,side=LEFT)
#creating mainloop
ws.mainloop()
OUTPUT
20
CONCLUSION
21
REFERENCES
22