Skip to main content

Posts

Showing posts from March, 2018

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(amo

C Program for Password Login IN CUI

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 #include <stdio.h> char str; char passwd[ 100 ]; void main () { int i = 0 ,j; printf( "Enter the text now \n " ); while ((str = getch()) != '\r' ) { if (str == '\b' ){ // if a backspace key is used then go back printf( " \b \b " ); i -- ; } else { passwd[i ++ ] = str; printf( "*" ); // hide the password } } printf( " \n Finished " ); printf( " \n Your password is ->" ); for ( j = 0 ;j < i;j ++ ) printf( "%c" ,passwd[j]); getch(); }

bank account simple project on python .

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

python program get union of two list (program to get A union B ) list method .

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 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 16 17:08:52 2018 @author: beast """ def version1 (): a = [ 'a' , 'b' , 'c' , 'd' , 'e' ] # list 1 b = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' ] # list 2 c = [k for k in (a) if (k in (a) and k not in (b))] # include unique item from list 1 : items are (list1-list2)(set thoery) d = [l for l in (b) if l in (a ) and l in (b) or (l not in (a) and l in (b))] #include all the comman from list 1 and unique from list 2 lst = c + d # append above two comprehensed list to get union of list1 U list2 lst . sort() # not neccessay but makes list easy to understand (sorting in ascending order )

python prgram for matrix addition (user based input )without using numpy or array

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 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 13 14:25:56 2018 @author: beast Note this program is for holding int value to list only """ def addmatrix (): matrixA = list () # intialize matrix as empty list matrixB = list () #intialize matrix as empty matrixS = list () #store the sum try : row,col = [ int (j) for j in ( input ( "Enter the row and col " ) . split())] print (row,col) inp = "" except ValueError : print ( "Please Enter row and col seperated by space eg: 2 2" ) inmatrix() for i in range (row): for j in range (col): inp += (( input ( "Enter the number for matrix

python program to take nested list input ...(nested list addition ,substraction etc)

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 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 13 14:25:56 2018 @author: beast Note this program is for holding int value to list only """ def inmatrix (): matrixA = list () # intialize matrix as empty list try : row,col = [ int (j) for j in ( input ( "Enter the row and col " ) . split())] print (row,col) inp = "" except ValueError : print ( "Please Enter row and col seperated by space eg: 2 2" ) inmatrix() for i in range (row): for j in range (col): inp += (( input ( "Enter the number--->" )) + "," ) try : lst = [ int (a) for a in inp . split( "," ) if a != "" ] #delete int for making it to hold any data

python program to to sum the number of list except number between specific range

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 lst = list ( map ( int , input ( "Enter number seperated by space " ) . split())) s = 0 try : in6 = lst . index( 6 ) in7 = lst . index( 7 ) except ValueError : in6 = 1 ;in7 = 0 if in6 < in7: for i in range (in6): s += lst[i] for j in range ((in7 + 1 ), len (lst)): s += lst[j] else : s = sum (lst) print ( "sum=" ,s)

Python Program to Count the Occurrences of Each letter in a Given text file and write output to a file

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 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 11 16:59:37 2018 @author: beast """ total = 0 file_name = "random.txt" #text filename of which letter frequency has to be obtained alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" # a simple string containing letter which frequency has to be calculated freq_dict = { letter : 0 for letter in alphabet } # dict comprehesnion and initialization all key with 0 s = open (file_name, "r" ) str = s . read() # get all the content for letter in str : # getting each character if letter in alphabet: #if it belong to alphabet group then only count freq_dict[letter] += 1 total += 1 # increase the count s . close() # close reading of input file output = open ( "Letter_frquency_outpput_generated.txt&qu

python program to generate random strings,numbers and export them to a file

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 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 11 16:03:44 2018 @author: beast """ from random import * file_limit = 50000 #a file with (size) number of characters with open ( "random.txt" , "w" ) as file : for i in range (file_limit): start = choice([ 48 , 65 , 97 ]) #make choice among three group i.e whether new character should be a digit ,uppercase or lowercase character end = 0 #initialize end with 0 if start == 48 :end = 58 # deicde end point elif start == 65 :end = 91 else :end = 123 breakrnd = randint( 0 , 2 ) breakrnd2 = randint( 0 , 2 ) breakrnd3 = randint( 0 , 2 ) breakrnd4 = randint( 0 , 2 ) rand = randrange(start,end) #now select any character from given range file . write( &quo

Jio payment launch date 14 march 2018

Jio Payments Bank 🏦 Jio is going to launch its bank services soon. You must listen about Airtel payment bank, a bank service launched by Airtel for Airtel customers 👥, this is the exact same thing. Jio is also launching Jio payments bank services for their customers and for that SBI bank and Reliance Industries has come together. Payment Bank History 🗿 Airtel was first networking company to launch payment bank services in India and it was quite successful and now it’s looking like Jio might be the second company in networking field to launch 🚀 payment bank services in India this year. Jio Payments Bank Launch Date 📆 Jio is planning I mean Mukesh Ambani is planning to launch Jio payments bank services for their customers from 14,march 2018.Yes, friends, Jio is trying hard to launch its bank services till march 2018. Apply For Jio Payments Bank Jio made easy for us to open an account in Jio bank. The simplest and most common thing you need to have with yourself to ope

RCOM get UPC porting code. Trai advises..New way alternate number.By any network website based porting

Ambani-led telco  recently  received a deadline extension until March 20, 2018, to generate UPC to the users who’re yet to get out of the network. RCom’s website is still alive and if you want to generate a UPC, head over the website  http://www.rcom.co.in/ , where you can see a small banner as ‘UPC Code for MNP.’ Just click that, and you’ll be taken to the next screen, where you need to input your details such as Reliance Mobile number (of which the UPC needs to be generated), SIM number (can be found at the back of the SIM card) and Alternate mobile number, where you want to receive the UPC for port out. And the company will send an SMS with UPC for port out to the alternate number which you have entered during the process. This is a pretty straightforward process, and any user who’s yet to port out from RCom can generate the UPC.

SEEDR : SAVIOUR OF TORRENT DOWNLOADING

Seedr is a next-generation product aiming to bring the torrent experience to a whole new level. Although torrents are not exactly legal or safe, but they have now become part and parcel of our online life now. So, to access them in the fastest and safest way possible we have Seedr. Features: Stream movies, music, and books on any device With top-in-class streaming technology, Seedr allows you to watch movies, listen to music, or read anything in your torrent library directly from the cloud on any device. Private and safe Seedr has high-level transport encryption to protect your privacy, and there is no need to worry about malware, viruses, or outside tracking – Seedr is the barrier protecting you. Very fast Seedr runs on a high-speed backbone and can fetch torrents to the cloud within several minutes down to several seconds. Fetch and stream torrents on your mobile device If you’ve ever tried using torrents on either tablet or phone, you’d quickly find out how impractical