Calculator
Komil (9)

It's a simple calculator with few operators, please take a look and give me feedback on what I can do to shorten it (and run the same way it does with this coding) or ways to improve it (extra coding to make it efficient?)

You are viewing a single comment. View All
[deleted]

You might consider using eval after confirming the provided operator is valid. This would eliminate the if-then-elif loop, but using eval might be considered bad practise.

Komil (9)

@barrycarter I have 0 clue on what eval is, I just started learning, but thank you for the tip!