-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.py
28 lines (28 loc) · 982 Bytes
/
payment.py
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
#from datetime import date
class Payment:
"""תשלום אשראי"""
def __init__(self):
flag = False
self.name=input('enter your name')
while not flag:
try:
self.cardNumber=int(input('enter card number'))
if len(str(self.cardNumber))==16:
flag=True
except:
flag = False
flag = False
while not flag:
try:
self.date=int(input('enter date of card'))
if self.date/100<13 and self.date%100<32:
flag=True
except:
flag=False
self.cvv=input('enter cvv')
while len(self.cvv)!=3:
self.cvv = input('enter cvv')
def writeToFile(self):
myFile =open("C:/Users/1/Desktop/יד/פייתון/iceCREAM/report.txt",'a')
myFile.write(f'credit card number: **** **** **** {self.cardNumber%10000}\n')
myFile.close()