Search⌘ K
AI Features

Challenge: Program Usage at the Command Prompt as a Utility

Explore how to build a Python command-line utility that accepts arithmetic operators and integer operands to perform calculations. Understand handling command-line arguments and outputting the correct result based on user input.

Problem statement

Write a program that can be used at the command prompt as a calculating utility. The usage of the program is shown below:

python3 calc.py <switch> <n> <m>

In the ...