My function does exactly what they want it do, but still comes up with an error
Ah sorry - my error was that I'd used print instead of return. Sorry to hijack, and good luck!
@wavering_jodi: I tested your code using another compiler and it worked just fine, there was no error caused or anything.
But know that you don't really need to convert into a string so you can iterate over it and append.
Try diving by 10 and getting the remainder of it.
1234 % 10 -> 4 123 % 10 -> 3 12 % 10 -> 2 1 % 10 -> 1
Get those values and start multiplying, you'll see this will actually work as well.
The condition of it could be while n % 10 != 0, continue because 0 % 10 == 0 and so it's true and due to that, you can leave the loop instruction.
Try refreshing the page and executing again!
@coreslayer49537: Try to copy and paste your code into another compiler, such as repl.it , and check if something like that happens as well.
If everything is okay, try refreshing the page and executing again.
Edit: Nevermind the message above, glad you figured it out!
I understand it the best my way and I know it's right, but what can I do?
@wavering_jodi: Not sure if you have to print the return value so if you're still getting some sort of error, after fixing indentation, do print reverse("Python!") .
Edit: Confused the posts, my apologies!
woah, that's a totally different section. I'm on 13 products.
@wavering_jodi: My apologies! I thought the image right above my post was yours, my bad!
But try printing the the return value from it, if you're still getting errors.
Just make sure to follow all the instructions , so you can pass.
it literally did exactly what it was supposed to
total = 1
for i in number:
total *= i
total = 1
for i in lst:
total = total*i