Python Forum
Displaying number of currency - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Displaying number of currency (/thread-7583.html)



Displaying number of currency - danellapotter - Jan-16-2018

My assignment is to write a program using Python which accepts amount as integer from the user and displays total number of Notes (Currency) 100, 50, 20, 10, 5 and 1.

This is what I made in response:
print(“How much are you depositing today?”)
number=int(input(“How much are you depositing today?”))

hundreds = number // 100
number = number – 100 * tens
fifties = number // 50
number = number – 50 * fifties
tens = number // 10 
number = number – 10 * tens
fives = number // 5
number = number – 5 * fives 
ones = number // 1
number = number – 1 * ones 
When I use this on python 3.6.0 I get a syntax error, not sure what.
Please help.


RE: Displaying number of currency - nilamo - Jan-16-2018

(Jan-16-2018, 05:01 PM)danellapotter Wrote: When I use this on python 3.6.0 I get a syntax error, not sure what.
What's the error? Please share the whole traceback.

If I had to guess, it's because you don't have quotes around the string you're printing/passing to input. You're using those pretend quote characters that Word likes to insert everywhere, instead of an actual quote character.


RE: Displaying number of currency - buran - Jan-16-2018

on line#5 you have variable tens which is not yet defined. I guess you mean hundreds
That said, please always post full traceback in error tags, when you get one


RE: Displaying number of currency - buran - Jan-16-2018

aaa, I guess you copy/paste this from a book - double quotes and minus are not ascii chars
should be "
and
should be -

when you fix this, you will get the error I refer to in my previous post