@iSimooApple/

Bank ATM Machines

Python 2.7

Class lesson - Coretabs

fork
loading
Files
  • main.py
  • withdraw.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.18798265988784402","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"Y2xhc3MgQVRNICgpOgoJZGVmIF9faW5pdF9fIChzZWxmLCB5b3VyX2JhbGFuY2UsIGJhbmtfbmFtZSwpOgoJCQoJCXNlbGYuYmFsYW5jZSA9IHlvdXJfYmFsYW5jZQoJCXNlbGYub3JpZ2luX2JhbGFuY2UgPSB5b3VyX2JhbGFuY2UKCQlzZWxmLm5hbWUgPSBiYW5rX25hbWUKCQlzZWxmLnN0YXRlbWVudCA9IFtdCgoJZGVmIHdpdGhkcmF3IChzZWxmLCByZXF1ZXN0KToKCQkjQXZhaWxhYmxlIGNhc2ggcGFwZXIgaXM6IDEwMDAsIDUwMCwgMjAwLCAxMDAKCQlwcmludCAiV2VsY21vbWUgdG8iLCBzZWxmLm5hbWUKCgkJZGVmIG11bHRpcGxlc19jaGVjayAobik6CgkJCWlmIG4gJSAxMDAgPT0gMDoKCQkJCXJldHVybiBUcnVlCgkJCXJldHVybiBGYWxzZQoKCQlkZWYgY2FzaF9DaGFuZ2UgKHJlcXVlc3QpOgoJCQljYXNoID0gWzEwMDAsIDUwMCwgMjAwLCAxMDBdCgkJCWZvciBwYXBlciBpbiBjYXNoOgoJCQkJd2hpbGUgcmVxdWVzdCA+PSBwYXBlcjoKCQkJCQlyZXF1ZXN0IC09IHBhcGVyCgkJCQkJcHJpbnQgIiggR2l2ZW4gPT0+ICAxIHgiLCBwYXBlciwiKSIKCgkJaWYgcmVxdWVzdCA+IHNlbGYuYmFsYW5jZToKCQkJcHJpbnQgIlNvcnJ5ISwgeW91IGRvbid0IGhhdmUgZW5vdWdoIGJhbGFuY2UgdG8gd2l0aGRyYXcgaW4geW91ciBhY2NvdW50LiIKCQkJcHJpbnQgIllvdXIgYmFsYW5jZSBpczog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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIgoJCXByaW50ICJZb3VyIHJlY2VudCB0cmFuc2FjdGlvbiBzdGF0ZW1lbnQgb2YiLCBzZWxmLm5hbWUsICI6IgoKCQlmb3IgdHJhbnMgaW4gc2VsZi5zdGF0ZW1lbnQ6CgkJCXNlbGYub3JpZ2luX2JhbGFuY2UgLT0gdHJhbnMKCQkJcHJpbnQgIi0iLHRyYW5zLCAiIC8gWW91ciBuZXcgYmFsYW5jZSBpcyBBRUQiLCBzZWxmLm9yaWdpbl9iYWxhbmNlCgkJcHJpbnQgIlxuVGhhbmsgeW91LlxuLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iCg=="},"asBuffer":null},"loaded":true}}
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--------------------------------------------"