Share your repls and programming experiences

← Back to all posts
Python Calculator
UZ (10)

I am about 100% sure you have all seen one of these before, they are so common, but I just wanted to share this because it took me a long time to figure it all out. Also, the bit at the beginning is completely pointless, it's just there.

Commentshotnewtop
UZ (10)

@PyShare Thank you very much, the code did look quite ugly. Thanks for cleaning it!

PyShare (5)

You could use time.sleep() to create a waiting system, it would tidy it up.

PyShare (5)

This is indeed common, but they are still cool to see.

PHF (2)

It's pretty good, but I would like to say that you could tidy up the code a little. It's mainly where you print the blank spaces. I think you want a waiting system, so I'll see if I can 'fix' this for you.

UZ (10)

@PHF I understand. I mainly added the blank spacing as breaks and as a way to wait, but I soon found it was extremely ineffective.

PHF (2)

@UZ Yeah, it prints as much as it can as fast as it can, so blank spaces are a very pointless way to add a pause, and they just take up way too much space.

UZ (10)

@PHF Got you, will make sure to keep my coding neat.

gibo (0)

You can use eval instead of having to write a function for every option.