num = zero
if input() = 1:
num = one
12/1/2021 2:27:32 AM
Also: input returns a string, so the condition in your if statement will always be False.
num = "zero"
if input() == "1":
num = "one"
Can you send fixed code please?
Hello, HELP MEl!
Of course you have a error, in num = zero have be num = "zero" and in num = one is num = "one".
Because there are not variable/function with that name.
You're right, is as I say.
In the if statement you have to use the comparison operator "==", not the assignment operator "=".
Use 0 and "1" instead of zero and one. Because the latter ones are identifiers
Or use quotation marks if you want to use strings.
I'm trying to do a project that turns numbers to word numbers
aka 1 - one
Send us a message