This program takes a user input to choose which calculation method they'd like to use, then uses a separate module and the math library to perform said calculation.
I'd like some feedback as to how this looks as a Python program. Have I broken any major rules? I've been learning Python for maybe two weeks now; the last time I used it was at high school in 2017.
main.py
import math
from modules import arithmetic
programRunning = True
# Exploration of Python's fundamentals.
# Match Case selection for calculation selection:
while(programRunning):
print("\nPlease select the calculation that you wish to perform:")
print("\n-------------------------------------------------------")
print("0 -- Square root")
print("1 -- Exponents")
print("2 -- Cube Root")
print("-------------------------------------------------------")
calculationSelection = int(input("\nPlease select the calculation that you wish to perform:"))
match calculationSelection:
case 0:
arithmetic.selectSquareRoot()
case 1:
arithmetic.selectExponent()
case 2:
arithmetic.selectCubeRoot()
case _:
print("\nERROR: Invalid Selection\n")
arithmetic.py
import math
def selectSquareRoot(): # Square Root
squaredNum = int(input("\nPlease enter the square number to be rooted: "))
squareRootNum = math.sqrt(squaredNum)
print(f"\nThe square root of {squaredNum} is {squareRootNum}.")
def selectExponent(): # Exponents
exponentialNum = int(input("\nPlease enter the number to be raised: "))
powerNum = int(input("\nPlease enter the power to raise the number to: "))
raisedExponent = math.pow(exponentialNum, powerNum)
print(f"\n{exponentialNum} to the power of {powerNum} is {raisedExponent}.")
def selectCubeRoot(): # Cube Root
cubedNum = int(input("\nPlease enter the cubed number to be rooted: "))
cubeRootNum = math.cbrt(cubedNum)
print(f"\nThe cube root of {cubedNum} is {cubeRootNum}.")