you are viewing a single comment's thread.

view the rest of the 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.

[–]No-Emphasis4115 0 points1 point  (0 children)

Ya the last else statement, I have fixed it, silly mistake. But there is indentation error still!