Files
  • main.py
  • withdraw.py
main.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
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
class ATM ():
	def __init__ (self, your_balance, bank_name,):
		
		self.balance = your_balance
		self.origin_balance = your_balance
		self.name = bank_name
		self.statement = []

	def withdraw (self, request):
		#Available cash paper is: 1000, 500, 200, 100
		print "Welcmome to", self.name

		def multiples_check (n):
			if n % 100 == 0:
				return True
			return False

		def cash_Change (request):
			cash = [1000, 500, 200, 100]
			for paper in cash:
				while request >= paper:
					request -= paper
					print "( Given ==>  1 x", paper,")"

		if request > self.balance:
			print "Sorry!, you don't have enough balance to withdraw in your account."
			print "Your balance is: AED", self.balance, "\nThank you.\n**********\n"

		elif request <100:
			print "Please enter a minimum amount 100 or its multiples!\nThank you.\n**********\n"


		elif multiples_check(request) == False:
			print "you can't withdraw this amount please select a multiples of amount 100!\nThank you.\n**********\n"

		else:
			print "You have", self.balance, "AED in your account.\n"
			print "Requested Amount is AED", request
			self.balance -= request

			give = request
			cash_Change (request); print
			print "Amount AED", give, "has been withdrawen succesfully from your account."
			print "Your balance now is: AED", self.balance, "\nThank you.\n**********\n"
			self.statement.append(request)
			return self.balance

	def transactions (self):
		self.origin_balance
		print "--------------------------------------------"
		print "Your recent transaction statement of", self.name, ":"

		for trans in self.statement:
			self.origin_balance -= trans
			print "-",trans, " / Your new balance is AED", self.origin_balance
		print "\nThank you.\n--------------------------------------------"