Skip to main content

A simple OOP based python BANK account program


from time import gmtime, strftime


class Accounts:
    type='VERSION 1.0'
    def __init__(self,name,balance):
        self.name=name
        self.transtime=[]
        self.trans=[]
        self.trantype=[]
        self.balance=balance
        print "Account Created for ",self.name,"With Opening balance =",self.balance

   
    def withdraw(self,amount):
        if self.balance-amount>0:
            print "Amount withdrawn=",amount
            self.balance-=amount
            self.trans.append(amount)
            self.trantype.append("Withdraw")
            self.transtime.append(str(strftime("%a, %d %b %Y %H:%M:%S ", gmtime())))
            

        else :
            print "InSufficient balance"

    def deposit(self,amount):
        if amount>0:
            self.balance+=amount
            self.trans.append(amount)
            self.trantype.append("Deposit")
            self.transtime.append(str(strftime("%a, %d %b %Y %H:%M:%S ", gmtime())))
        else :
            print "Invalid amount "

    def showbal(self):
        print'*'*50
        print "Account of =",self.name
        print "Account balance=",self.balance
        print'*'*50
    def transactions(self):
        print'*'*50
        print "Account of =",self.name
        print '\tAMOUNT\t\tTYPE\tTIME'
        for i in range (len(self.trans)):
                 print'-'*80
                 print "\t",self.trans[i],"\t\t",self.trantype[i],self.transtime[i]
                 print'-'*80
             

print ("Entering in Program")
raj=Accounts("Raj Dubey",100)
raj.showbal()
raj.deposit(3000)
raj.showbal()
raj.withdraw(1200)
raj.showbal()
raj.deposit(564)
raj.showbal()
raj.transactions()
mansur=Accounts("Mansur Alam",1)
mansur.showbal()
mansur.deposit(3000)
mansur.withdraw(564)
mansur.transactions()

Comments

Popular posts from this blog

13 websites to register your free domain

Register your Free Domain Now!! 1)  .tk Dot TK is a FREE domain registry for websites on the Internet. It has exactly the same power as other domain extensions, but it’s free! Because it’s free, millions of others have been using .TK domains since 2001 – which makes .TK powerful and very recognizable.  Your website will be like www.yourdomainname.tk . It is free for 1 year. It’s a ccTLD domain whixh having the abbreviation  Tokelau. To create a .tk domain, Visit   www.dot.tk 2) co.cc Co.cc is completely free domain which is mostly used by blogspot bloggers because of it’s easy to use DNS system. Creating a co.cc for blogger is simple ( for instructions- “click here”). Your website will be like www.yourdomainname.co.cc . To create a .co.cc domain, visit www.co.cc 3)   co.nr co.nr is too like co.cc. Your website will be like  www.yourdomainname.co.nr . You can add it for blogger also.. To create a .co.cc domain, vi...

How to Put Google Adsense Below Post Title in Blogger?

Adsense is used by majority of expert bloggers for their website monetization because it is a cookie based contextual advertising system that shows targeted ads relevant to the content and reader. As bloggers are paid on per click basis, they try various ad placements on the blog to  increase the revenue  and get maximum clicks on the ad units. Well, on some blogs, you might have seen Adsense ad units placed below the post title. Do you know why? It is because the area just below the post title gets the most exposure and is the best place to put AdSense ad units to increase  Click Through Rate (CTR). Even though ads below post title work like a charm but this doesn’t mean that it will work for you as well. If you want to find out the best AdSense ads placement for your blog, try experimenting by placing ads at various locations such as header, sidebar, footer, etc. You can try other  blog monetization methods  as well to effectively monetize y...

C++ Program to Find HCF and LCM among 4 numbers (Easiest Logic)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include <iostream> #include <math.h> using namespace std; int main () { int a,b,c,d,i,j,minimum; cout << "Enter the all four number " ; cin >> a >> b >> c >> d; if (a < b && a < c && a < d) minimum = a; else if (b < c && b < d) minimum = b; else if (c < d) minimum = c; else minimum = d; for (j = minimum;; -- j) { if (a % j == 0 && b % j == 0 && c % j == 0 && d % j == 0 ) { break ; } } for (i = 1 ;;i ++ ) { if (i % a == 0 && i % b == 0 && i % c == 0 && i % d == 0 ) break ; } cout << "Lowest Common factor=>" << i << endl; ...

50 intesting facebook facts

some facts about facebook if u type @[4:0] in any facebook comment box it will write mark zukerburg 1 in every 13 people on Earth is on Facebook 35+ demographic represents more than 30% of the entire user base 71.2 % of all USA internet users are on Facebook In 20 minutes 1,000,000 links are shared on Facebook In 20 minutes 1,484,000 event invites are posted In 20 minutes 1,323,000 photos are tagged In 20 minutes 1,851,000 status updates are entered In 20 minutes 1.972 million friend requests are accepted In 20 minutes 2,716,000 photos are uploaded In 20 minutes 2,716,000 messages are sent In 20 minutes 10.2 million comments are posted In 20 minutes 1,587,000 wall posts are written 750 million photos were uploaded to Facebook over New Year’s weekend 48% of young Americans said they found out about news through Facebook 48% of 18 to 34 year olds check Facebook right when they wake up 50% of active users log on to Facebook in any given day Average user has 130 friends ...

USE any TRIAL SOFTWARE FOREVER WITHOUT SERIAL NUMBER

USE any TRIAL SOFTWARE FOREVER WITHOUT SERIAL NUMBER(most wanted trick) Run a trial software forever now with time stopper you can run a trial software forever no need to fetch for serial numbers,activation codes,patch just DOWNLOAD TIME STOPPER now open it install it click browse select the .exe of the software or file which you want to run forever now simply click create desktop icon and now delete all its existing shortcuts now have fun enjoying software for life time

python program to Print Starting Series OF Indian Mobile Number for a State or operator or both

import requests import urllib.request import time from bs4 import BeautifulSoup as bs import re url = ' https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India' state_to_extract = "UE" #if set to None all state is considered telecom_to_extracted = None #if set to none all operator from particular city is extracted response = requests . get(url) print (response) soup = bs(response . text, "html.parser" ) one_a_tag = soup . findAll( 'tr' )[ 35 :] lst = [] for k in one_a_tag: s = k . findAll( 'td' ) limit = len (s) i = 0 while True : if i == limit: break no = s[i] . text i += 1 if i == limit: break operator = s[i] . text i += 1 if i == limit: break state = s[i] . text i += 1 if i == limit: break res = f "{no} {operator} {state}" if state_to_extract is None : if telecom_to_extracted is None : lst . append(no) elif telecom_to_e...

Is your Nokia Cell Phone Original

Nokia is one of the largest selling phones across the globe. Most of us own a Nokia phone but are unaware of it’s originality. Are you keen to know whether your Nokia mobile phone is original or not? Then you are in the right place and this information is specially meant for you. Your phones IMEI (International Mobile Equipment Identity) number confirms your phone’s originality. Press the following on your mobile *#06# to see your Phone’s IMEI number(serial number).   Then check the 7th and 8th numbers Phone serial no. x x x x x x ? ? x x x x x x x IF the Seventh & Eighth digits of your cell phone are 02 or 20 this means your cell phone was assembled in Emirates which is very Bad quality IF the Seventh & Eighth digits of your cell phone are 08 or 80 this means your cell phone was manufactured in Germany which is fair quality   IF the Seventh & Eighth digits of your cell phone are 01 or 10 this means your cell phone was manufactured in Finland whic...

C++ program to implement Booth's multiplier

  1  #include <iostream>   2  #include <windows.h>   3  #include <fstream>   4  #include <math.h>   5  #define pause system("pause");   6  using namespace std ;   7  const int no_of_bits = 32 ;   8  /* this Program uses Following notations.... first bit for signed and then it goes like this 1 2 4 8 16 32 64......   9  /* ----------------------------------------global variables ----------------------------------  10  */  11  int Q1 = 0 ; /// extra bit holder  12  int A [ no_of_bits ]; /// Accumulator storing array  13  int Q [ no_of_bits ]; /// Multiplier storing Array.  14  int N , Qsize ; /// no of bits in multiplier  15  int X ; /// no of bits in multiplicand.  16  int M [ no_of_bits ]; /// M value  17  int M2Complement [ no_of_bits ]; /// -M  18  in...

6 Ways to Hack or deface Websites Online

Hello friends , today i will explain all the methods that are being used to hack a website or websites database. This is the first part of the hacking websites tutorial where i will explain in brief all methods for hacking or defacing websites. Today I will give you the overview and in later tutorials we will discuss them one by one with practical examples. So guys get ready for first part of Hacking websites class.... Don't worry i will also tell you how to protect your websites from these attacks and other methods like hardening of SQL and hardening of web servers and key knowledge about CHMOD rights that what thing should be give what rights... Note : This post is only for Educational Purpose only. What are basic things you should know before website hacking? First of all everything is optional as i will start from very scratch. But you need atleast basic knowledge of following things.. 1. Basics of HTML, SQL, PHP. 2. Basic knowledge of Javascript. 3. Basic knowled...