print(\"Welcome to BreakDown 2000.\") print(\"\") print(\"Here we will take your
ID: 3859852 • Letter: P
Question
print("Welcome to BreakDown 2000.")
print("")
print("Here we will take your total cents and break it down to the various denominations absoulutly free of charge.")
print("")
print("You will know exactly how much of each you will need without getting a brain tumor trying to figure it out yourself. Lets get started.")
print("")## Friendly welcome message to the user
num = int(input('Please input total cents(positive numbers only) ')) ##Asking user to input cents
hundredDollar = 0 ## Declaring of the various variables. All int & all set to a value of 0
fiftyDollar = 0
twentyDollar = 0
tenDollars = 0
dollars = 0
quarters = 0
dimes = 0
nickels = 0
pennies = 0
while num <= 0: ## Loop to make sure user inputs a positive number
print ("The number you have entered is invalid. Try again.")
num = int(input('Please input total cents(positive numbers only) '))
while num >= 10000: ## Loop to determin amount of $100
num = num - 10000
hundredDollar = hundredDollar +1
while num >= 5000: ## Loop to determin amount of $50
num = num - 5000
fiftyDollar = fiftyDollar + 1
while num >= 2000: ## Loop to determin amount of $20
num = num - 2000
twentyDollar = twentyDollar + 1
while num >= 1000: ## Loop to determin amount of $10
num = num - 1000
tenDollars = tenDollars + 1
while num >= 100: ## Loop to determin amount of $1
num = num - 100
dollars = dollars + 1
while num >= 25: ## Loop to determin amount of quarters
num = num - 25
quarters = quarters + 1
while num >= 10: ## Loop to determin amount of dimes
num = num - 10
dimes = dimes + 1
while num >= 5: ## Loop to determin amount of nickels
num = num - 5
nickels = nickels + 1
while num >= 1: ## Loop to determin amount of pennies
num = num - 1
pennies = pennies + 1
print ("")
print ('Hundred Dollars = $',hundredDollar,'Fifty Dollars = $',fiftyDollar,'Twenty Dollars = $',twentyDollar,'Ten Dollars = $',tenDollars,'One Dollars = $',dollars)
print ("")
print ('Quarters =',quarters,'Dimes =', dimes, 'Nickels =', nickels, 'Pennies =', pennies) ##Displays the result
print ("")
print ("Thank you for using BreakDown 2000. We hope you will come back the next time you need us.") ##User Friendly Dismissal message
I keep getting an error message
EOL while scanning literal
I don't know what I am doing wrong
Explanation / Answer
NOTE: i dont find any issues in your code. I have tested and does not find any problems. I am guessing it might be some indentation issue. Please check the code in below link and let me know if you face any issues. Kindly let me know if your expectation is different here. I will revert back within 24 hours.
code:
http://pasted.co/557cd54b
code output screenshot:
https://pasteboard.co/GCmkC3V.png
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.