Here's how you can create a simple calculator in Python that takes user input and performs arithmetic operations based on the user's choice:
main.py672 chars21 lines
This code takes user input for two numbers and the arithmetic operation they want to perform. Then, it uses conditional statements (if-elif-else) to determine which arithmetic operation to perform based on the operator input. Finally, it prints the result of the arithmetic operation.
gistlibby LogSnag