Skip to content

First solution - #121

Open
yahillel wants to merge 1 commit into
osherdp:masterfrom
yahillel:solved_ATM
Open

First solution#121
yahillel wants to merge 1 commit into
osherdp:masterfrom
yahillel:solved_ATM

Conversation

@yahillel

Copy link
Copy Markdown

Solution for ATM, does not use classes and does not allow multiple
operations

Solution for ATM, does not use classes and does not allow multiple
operations
Comment threadATM.py
entry = line.split()
# print(entry)
try:
int(entry[2]) # used solely to verify entry has three values

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make those magic number consts

Comment threadATM.py
if not (action in OPERATIONS):
print('Operation not recognized')
continue
operation = OPERATIONS.get(action)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big like!

Comment threadATM.py
import sys
INPUT_FILENAME_ARG_NUM = 1


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create an atm class with all those functions

Comment threadATM.py
print('Unaccepted value')
customer_sum = int(customer_data[1]) - withdrawal_int_sum
customer_data[1] = str(customer_sum)
# print('Your balance is {}NIS'.format(customer_data[1]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you do want to print the new balance do that with you dedicated function

Comment threadATM.py
print('Unaccepted value')
customer_sum = int(customer_data[1]) + deposit_int_sum
customer_data[1] = str(customer_sum)
# print('Your balance is {}NIS'.format(customer_data[1]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

balance print again

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yahillel@ranbentzvi