Report
Report
on
PYTHON
at
COURSERA
Submitted by :
DIPANSHU SINGH
Roll No. - 1900300100078
Bachelor of Engineering
in
Computer Science and Engineering
Student Signature
Student Name : DIPANSHU SINGH
Roll No:- 1900300100078
Date: 20.10.22
Acknowledgement
The successful completion of any project requires guidance help from a number of people. I
take my immense pleasure in expressing a whole hearted thanks to all the officials who
guided me all the way through my training in the organization.I therefore take this
opportunity to express my profound sense of gratitude to all those who extended their whole
hearted help and support to me in carrying out the project work.
I express my deep gratitude to Ms Harshita JAIN who provided mean insight into the
working that enhanced my knowledge and with their support and cooperation this report has
taken a presentable form.
Dipanshu singh
Contents
1 INTRODUCTION TO ORGANIZATION(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.................................
3 PROJECT WORK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..............
5 References
Preface
It is well evident that work experience is an indispensable part of every professional course.
In the same manner practical training in any organization is a must for a Bachelor of
Engineering course. This training gives more knowledge about the real corporate world
environment. It also helps the individual to improve his/her skills to a great extent and assess
his/her personality in corporate life.
Classroom study is quite important for gaining theoretical knowledge, but practical
knowledge is equally important for the candidates to improve skills in a real working
environment in any field of study.
To be a good engineer, one must be aware of the industrial environment and must know about
project management, working in the industry and so on. To bridge the gap between college
and industrial environment summer training is one of the effective ways of learning. During
this period, a student practices in the industry and gains experience and knowledge about
working in industry.
ABSTRACT
Bank Management System project is written in Python. The project
file contains a python script (main.py) and a database file. This is a
simple console based system which is very easy to understand and
use. Talking about the system, it contains all the basic functions
which include creating a new account, view account holders record,
withdraws and deposit amount, balance inquiry, closing an account
and edit account details. In this mini project, there is no such login
system. This means he/she can use all those available features easily
without any restriction. It is too easy to use, he/she can check the
total bank account records easily.
CHAPTER 1
INTRODUCTION TO ORGANISATION
Coursera is an American massive open online course (MOOC) provider founded
in 2012 by Stanford University's computer science professors Andrew Ng and
Daphne Koller that offers massive open online courses (MOOC),
specializations, degrees, professional and master track courses. Coursera
works with universities and other organizations to offer online courses,
certifications, and degrees in a variety of subjects, such as engineering, data
science, machine learning, mathematics, business, financing, computer
science, digital marketing, humanities, medicine, biology, social sciences, 3000
plus variety of courses giving students a very broad range of information &
experience in different fields. Coursera courses last approximately four to
twelve weeks, with one to two hours of video lectures a week. These courses
provide quizzes, weekly exercises, peer-graded and reviewed assignments, an
optional Honors assignment and sometimes a final project or exam to
complete the course.[22] Courses are also provided on-demand, in which case
users can take their time in completing the course with all of the material
available at once. As of May 2015, Coursera offered 104 on-demand courses it
also provides guided projects which are short 2-3 hour projects that can be
done. As of 2017, Coursera offers full master's degrees. They first started with
Master's in Innovation and Entrepreneurship (OMIE) from HEC Paris and
Master's of Accounting (iMSA) from the University of Illinois, but have moved
on to offer Master of Computer Science in Data Science and Master of Business
Administration (iMBA), both from University of Illinois.
SOFTWARE TRAINING WORK
UNDERTAKEN
PYTHON FOR EVERYBODY
Week 1
• Code:print(“hello world”)
• Output:hello world
Week 2
Week 3
Week 4
The fourth week comprises the introduction to expressions in python
,their use and implementation. The various expressions such as
constants ,variables ,arithmetic expressions ,reserved words ,
assignment statements were also taught.
print(“Hello ”, name)
• Code-
• x = float(hrs) * float(rate)
• print("Pay:",x)
• output: 96.25
Week 5
• h = int(hrs)
• r = float(rate)
• if hrs<=40:
• pay=h*r
• else:
• pay=(h-40)*(1.5*r)+(40*r)
• print(pay)
• Output: 498.75
Week 6
• if (h<=40):
• p=h*r
• return p
• else:
• p=((h-40)*1.5*r)+(40*r)
• return p
• h=float(hrs)
• rate=input("enter rate:")
• r=float(rate)
• p = computepay(h,r)
• print("Pay",p)
Week 7
The last week covers about the loops used in python,why are loops
required,their syntax is also covered.The concept of finding the
largest number from the given list of numbers is also discussed with
the help of Python code.
• smallest = None
• while True:
• try:
• if num == "done" :
• break
• num=int(num)
• largest = num
• smallest = num
• except ValueError:
• print("Invalid input")
• print("Maximum is",largest)
• print("Minimum is",smallest)
• Output :
• Invalid input
• Maximum is 10
• Minimum is 2
2.2
Week 1
Week 2
Week two covers topics like how to select a text editor and use
python code playground,taking screenshots and introduction to
Python coding.
Week 3
• fh = open(fname)
• line=line.rstrip()
• line=line.upper()
• print(line)
• Output :
YOU KNOW HOW TO PROGRAM, YOU WILL FIGURE OUT WHAT YOU
WANT
X-DSPAM-Confidence: 0.8475
Count these lines and extract the floating point values from each of
the lines and compute the average of those values and produce an
output as shown below. Do not use the sum() function or a variable
named sum in your solution.
• if len(fname) == 0:
• fname = 'mbox-short.txt'
• fh = open(fname)
• count = 0
• tot = 0
• ans = 0
• count = count + 1
• num = float(line[21:])
• fh = open(fname)
• lst = list()
• word=line.rstrip().split()
• if element in list:
• continue
• else:
• lst.append(element)
• lst.sort()
• print(lst)
• You will parse the From line using split() and print out the
second word in the line (i.e. the entire address of the person who
sent the message). Then print out a count at the end.
• Hint: make sure not to include the lines that start with 'From:'.
Also look at the last line of the sample output to see how to print the
count.
• c=0
• fh = open(fname)
• words=line.split()
• print(words[1])
• c=c+1
• Output: stephen.marquard@uct.ac.za
• louis@media.berkeley.edu
• zqian@umich.edu
• rjlowe@iupui.edu
• zqian@umich.edu
• rjlowe@iupui.edu
• cwen@iupui.edu
• cwen@iupui.edu
• gsilver@umich.edu
• gsilver@umich.edu
• zqian@umich.edu
• gsilver@umich.edu
• wagnermr@iupui.edu
• zqian@umich.edu
• antranig@caret.cam.ac.uk
• gopal.ramasammycook@gmail.com
• david.horwitz@uct.ac.za
• david.horwitz@uct.ac.za
• david.horwitz@uct.ac.za
• david.horwitz@uct.ac.za
• stephen.marquard@uct.ac.za
• louis@media.berkeley.edu
• louis@media.berkeley.edu
• ray@media.berkeley.edu
• cwen@iupui.edu
• cwen@iupui.edu
• cwen@iupui.edu
• There were 27 lines in the file with From as the first word
Week 5
• Code:
• name = "mbox-short.txt"
• handle = open(name)
• text = handle.read()
• #words = text.split()
• words = list()
• line = line.split()
• words.append(line[1])
• counts = dict()
•
• counts[word] = counts.get(word, 0) + 1
• maxval = None
• maxkey = None
• maxval = val
• maxkey = key
• print(maxkey, maxval)
• Output: cwen@iupui.edu 5
Week 6
Once you have accumulated the counts for each hour, print out the
counts.
• if len(name) < 1:
• name = "mbox-short.txt"
• handle = open(name)
• counts = dict()
• if line.startswith("From "):
• time = line.split()[5].split(":")
•
• #print sorted( [ (v,k) for k,v in counts.items()] )
• list = list()
• list.append( (key,value) )
• list.sort()
• print(hour, counts)
• Output:
• 04 3
• 06 1
• 07 1
• 09 2
• 10 3
• 11 6
• 14 1
• 15 2
• 16 4
• 17 2
• 18 1
• 19 1
Week 7
It marks the end of this course where the graduation ceremony and
the survey for the course takes place.
Chapter 3
PROJECT WORK
BANK MANAGEMENT SYSTEM
The features of the Bank Management System, a user can create an
account by providing the name of the account holder, number,
selecting amount type (Saving account or Current account) and
providing an initial amount more than or equal to 500. Then the user
can also deposit and withdraw money just by providing his/her
account and entering the amount. For certain purposes, he/she can
also check for the balance inquiry which displays the account number
and amount. He/she can also view all the account holder’s lists.
Another feature is that he/she can modify their account detail and
type if they want to.
CODE :
class Account:
accNo = 0
name = ''
deposit = 0
type = ''
def showAccount(self):
print("Account Number : ", self.accNo)
print("Account Holder Name : ", self.name)
print("Type of Account", self.type)
print("Balance : ", self.deposit)
def modifyAccount(self):
print("Account Number : ", self.accNo)
self.name = input("Modify Account Holder Name :")
self.type = input("Modify type of Account :")
self.deposit = int(input("Modify Balance :"))
def report(self):
print(self.accNo, " ", self.name, " ", self.type, " ", self.deposit)
def getAccountNo(self):
return self.accNo
def getAcccountHolderName(self):
return self.name
def getAccountType(self):
return self.type
def getDeposit(self):
return self.deposit
def displayAll():
file = pathlib.Path("accounts.data")
if file.exists():
infile = open('accounts.data', 'rb')
mylist = pickle.load(infile)
for item in mylist:
print(item.accNo, " ", item.name, " ", item.type, " ", item.deposit)
infile.close()
else:
print("No records to display")
def displaySp(num):
file = pathlib.Path("accounts.data") if
file.exists():
infile = open('accounts.data', 'rb')
mylist = pickle.load(infile)
infile.close()
found = False for
item in mylist:
if item.accNo == num:
print("Your account Balance is = ", item.deposit)
found = True
else:
print("No records to Search") if
not found:
print("No existing record with this number")
else:
print("No records to Search")
outfile = open('newaccounts.data', 'wb')
pickle.dump(mylist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
def deleteAccount(num):
file = pathlib.Path("accounts.data") if
file.exists():
infile = open('accounts.data', 'rb')
oldlist = pickle.load(infile)
infile.close()
newlist = []
for item in oldlist:
if item.accNo != num:
newlist.append(item)
os.remove('accounts.data')
outfile = open('newaccounts.data', 'wb')
pickle.dump(newlist, outfile)
outfile.close()
os.rename('newaccounts.data', 'accounts.data')
def modifyAccount(num):
file = pathlib.Path("accounts.data") if
file.exists():
infile = open('accounts.data', 'rb')
oldlist = pickle.load(infile)
infile.close()
os.remove('accounts.data')
for item in oldlist:
if item.accNo == num:
item.name = input("Enter the account holder name : ")
item.type = input("Enter the account Type : ") item.deposit
= int(input("Enter the Amount : "))
def writeAccountsFile(account):
file = pathlib.Path("accounts.data") if
file.exists():
infile = open('accounts.data', 'rb')
oldlist = pickle.load(infile)
oldlist.append(account)
infile.close()
os.remove('accounts.data')
else:
oldlist = [account]
outfile = open('newaccounts.data', 'wb')
pickle.dump(oldlist, outfile) outfile.close()
os.rename('newaccounts.data', 'accounts.data')
while ch != 8:
# system("cls"); print("\tMAIN
MENU") print("\t1. NEW
ACCOUNT")
print("\t2. DEPOSIT AMOUNT")
print("\t3. WITHDRAW AMOUNT")
print("\t4. BALANCE ENQUIRY")
print("\t5. ALL ACCOUNT HOLDER LIST")
print("\t6. CLOSE AN ACCOUNT") print("\
t7. MODIFY AN ACCOUNT")
print("\t8. EXIT")
print("\tSelect Your Option (1-8) ")
ch = input()
# system("cls");
if ch == '1':
writeAccount()
elif ch == '2':
num = int(input("\tEnter The account No. : "))
depositAndWithdraw(num, 1)
elif ch == '3':
num = int(input("\tEnter The account No. : "))
depositAndWithdraw(num, 2)
elif ch == '4':
num = int(input("\tEnter The account No. : "))
displaySp(num)
elif ch == '5':
displayAll();
elif ch == '6':
num = int(input("\tEnter The account No. : "))
deleteAccount(num)
elif ch == '7':
num = int(input("\tEnter The account No. : "))
modifyAccount(num)
elif ch == '8':
print("\tThanks for using bank management system")
break
else:
print("Invalid choice")
OUTPUT :
WITHDRAW AMOUNT :
BALANCE ENQUIRY:
MODIFY AN ACCOUNT :
REFERENCE
Coursera : https://www.coursera.org/
Wikipedia : https://en.m.wikipedia.org/wiki/Coursera