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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | import pickle accounts=dict() class Account: """SImple bank account """ def __init__(self,name,balance): self.name=name self.balance=balance def getname(self): return self.name def deposit(self,amount): if amount>0: self.balance+=amount def withdraw(self,amount): try: assert (amount>0) except: print("NO negative amount could be withdrawn") try: assert (balance-amount>0) except : print("maximum balance that could be withdrawn =",balance) balance-=amount def showbalance(self): print("*"*80,"\n\t\tCurrent Balance->",self.balance,"\b\n","*"*79) return self.balance def getbalance(self): return self.balance def new(): while True: name='' print("\n1.to Add an Account \n2.Deposit\n3.Withdraw\n4.View Balance\n5.View All Accounts Currenty Available \n6.Exit \n S or s to save ") choice=input() if choice=='1': name=input("Enter name->") temp=Account(name,0.0) accounts[name]=temp elif choice=='2': if name=='': name=input("Enter Name:->") if name in accounts.keys(): print("how much to add") amount=float(input()) if name in accounts: temp=accounts[name] temp.deposit(amount) else: print('Error Account Do not exist ') elif choice=='3': if name=='': name=input("Enter Name:->") if name in accounts.keys(): print("how much to Withdraw") amount=float(input()) if name in accounts: temp=accounts[name] temp.withdraw(amount) else: print('Error Account Do not exist ') elif choice=='4': if name=='': name=input("Enter Name:->") if name in accounts: temp=accounts[name] temp.showbalance() else : print('Error Account Do not exist ') elif choice=='6': break elif choice=='121': print(accounts) elif choice=='5': print('*'*120) print('\n\tName\t\t\t\t\tBalance') for key in accounts.keys(): print('-' * 80) print('\t',key,'\t\t\t\t\t',accounts[key].getbalance()) print('-' * 80) print('*' * 120) elif choice=='s' or 'S': pic_file = open('account_dump', 'ab') key_file = open('keydump', 'wb') pickle.dump(accounts, key_file) key_file.close() for key in accounts.keys(): temp = accounts[key] print("temp being dumped", temp) temp.showbalance() pickle.dump(temp, pic_file, protocol=pickle.HIGHEST_PROTOCOL) pickle.dump(temp.balance, pic_file, protocol=pickle.HIGHEST_PROTOCOL) pic_file.close() else : print ('Please give correct input ') pass def load(): try: temp=open('keydump','rb') temp2=open('account_dump','rb') except Exception: print("NO previous record found . Start a new banking ") menu() details=pickle.load(temp2) key_details=pickle.load(temp) print('printing Key details') print(key_details) for i in (key_details): details = pickle.load(temp2) print("----1----",details.getbalance()) accounts[i]=details details = pickle.load(temp2) print("----2----", details.getbalance()) print('printing acc details') print(accounts) print('loading complete') temp2.close() temp.close() new() def menu(): choice=input('1.NEW Banking ---RESTART\n2.Load->') if choice=='1': new() if choice=='2': load() if choice=='q' or choice=='Q': exit() menu() if __name__=="__main__": menu() |
Definition of 3G: 3G is the third generation of wireless technologies. It comes with enhancements over previous wireless technologies, like high-speed transmission, advanced multimedia access and global roaming. 3G is mostly used with mobile phones and handsets as a means to connect the phone to the Internet or other IP networks in order to make voice and video calls, to download and upload data and to surf the net. How is 3G Better?: 3G has the following enhancements over 2.5G and previous networks: Several times higher data speed; Enhanced audio and video streaming; Video-conferencing support; Web and WAP browsing at higher speeds; IPTV (TV through the Internet) support. 3G Technical Specifications: The transfer rate for 3G networks is between 128 and 144 kbps (kilobits per second) for devices that are moving fast and 384 kbps for slow ones(like for pedestrians). For fixed wireless LANs, the speed goes beyond 2 Mbps. 3G is a set of technologies and stand
Comments
Post a Comment
share your thoughts ....