-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Open
Description
def inputValue():
count = 0
while True:
x = input("Enter value [D val/ W val/ total]: ")
x = x.split(" ")
if x[0] == 'total':
print(count)
elif x[0] == 'D':
count += int(x[1])
elif x[0] == 'W':
count -= int(x[1])
else:
print("Wrong input!")
continue
inputValue()
- To realize if programmer wishes to print the total or not without debugging every time but straight to run the program
Activity
Aneousion commentedon Jan 1, 2023
This is fine. You can choose to print the total.