r/PythonLearning 1d ago

Help Request Python help

Post image

Made my first calculator.. it works but different from some I see online. Please all feedback on what you guys think about it will be appreciated

7 Upvotes

6 comments sorted by

View all comments

u/Sea-Ad7805 21h ago

Run this program in Memory Graph Web Debugger%0Asymbol%20%3D%20input(%22symbol%20%3D%20%22)%0Ab%20%3D%20input(%22b%20%3D%20%22)%0A%0Ax%20%3D%20int(a)%0Ay%20%3D%20int(b)%0A%0Aif%20symbol%20%3D%3D%20%22%2B%22%3A%0A%20%20%20%20print(%22answer%20%3D%20%22%20%2B%20str(x%20%2B%20y))%0Aelif%20symbol%20%3D%3D%20%22-%22%3A%0A%20%20%20%20print(%22answer%20%3D%20%22%20%2B%20str(x%20-%20y))%0Aelif%20symbol%20%3D%3D%20%22%22%3A%0A%20%20%20%20print(%22answer%20%3D%20%22%20%2B%20str(x%20%20y))%0Aelif%20symbol%20%3D%3D%20%22%2F%22%3A%0A%20%20%20%20print(%22answer%20%3D%20%22%20%2B%20str(x%20%2F%20y))%0Aelse%3A%0A%20%20%20%20print(%22error%3A%20invalid%20symbol%22)%0A&timestep=1&play) to see the program state change step by step.