Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- While loop-lab
- # 5 Account Balance:
- account_balance = 0
- while True:
- command = input()
- if command == 'NoMoreMoney':
- break
- curr_sum = float(command)
- if curr_sum >= 0:
- account_balance += curr_sum
- print(f"Increase: {curr_sum:.2f}")
- else:
- print('Invalid operation!')
- break
- print(f'Total: {account_balance:.2f}')
- # 6. Max Number
- import sys
- max_number = - sys.maxsize
- while True:
- command = input()
- if command == 'Stop':
- break
- curr_num = int(command)
- if curr_num > max_number:
- max_number = curr_num
- print(max_number)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement