Solution: Program Usage at the Command Prompt as a Utility

Learn a program that can be used at the command prompt as a calculating utility.

We'll cover the following

The solution to the problem of writing a program that can be used at the command prompt as a calculating utility is given below.

Solution

After clicking the “Run” button, write the following command in the terminal below:

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

Note: When writing the code above, replace <switch> with any operator, and <n> and <m> with numbers. We can use +, -, x, and / as operators. We will use x in the terminal command and * in Python language for multiplication.

Get hands-on with 1200+ tech skills courses.