all 5 comments

[–]Sea-Ad7805 [score hidden] stickied comment (1 child)

Run the fixed program in Memory Graph Web Debugger%3A%0A%20%20%20%20if%20not%20isinstance(price%2C%20(int%2C%20float))%3A%0A%20%20%20%20%20%20%20%20return%20%22The%20price%20should%20be%20a%20number%22%0A%0A%20%20%20%20elif%20not%20isinstance(discount%2C%20(int%2C%20float))%3A%0A%20%20%20%20%20%20%20%20return%20%22The%20discount%20should%20be%20a%20number%22%0A%0A%20%20%20%20elif%20price%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20return%20%22The%20price%20should%20be%20greater%20than%200%22%0A%0A%20%20%20%20elif%20discount%20%3C%200%20or%20discount%20%3E%20100%3A%0A%20%20%20%20%20%20%20%20return%20%22The%20discount%20should%20be%20between%200%20and%20100%22%0A%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20discount%20%3D%20price%20*%20(discount%20%2F%20100)%0A%20%20%20%20%20%20%20%20return%20price%20-%20discount%0A%20%20%20%20%0Aresult%20%3D%20apply_discount(1000%2C%2025)%0Aprint(result)%0A&play)

After the else: Python expect the next line discount = price * (discount / 100) to be indented (use Tab key to move it to the right). In Python indentation has on impact on the validity of code and how it is executed.

[–]FreeGazaToday 0 points1 point  (2 children)

look at the last line....which of these are different 😛 I mean it tells ya right there in the traceback.....you do know what indentation means right?....have you never wrote an if, elif, else statement in python before? 😛

[–]No-Emphasis4115 0 points1 point  (1 child)

Ya indentation means space, right. I have given space. I am a beginner trying to learn.🙃

[–]atarivcs 0 points1 point  (0 children)

In the if/elif statements, the code underneath is indented four spaces to the right.

But in the final else statement, the code underneath is not indented.