Hi, I am currently working on Independent practice to work on the skills I have learned with python. note that the code is purposefully not “beautiful code” in an attempt to practice specific tools and structures within python. currently I am having the issue of calling functions and passing variables between functions or (returning variables). Note that there are commented out segments and the looping structure is still a work in progress. I would like to not only solve this issue but possibly even make this an exercise in the python modules. The code I have is as follows:

#skill keeper tests

#basic Calc app

#long way

#author: JV

#-----------------------------------------------------------------------------

#Pseudo code: create basic calculator app

#main menu must give value input options for subtraction

#addition, multiplication and division

#for sake of time will only work with two value inputs

#will not use read write or log functions to create history logs of value outputs

#will be looping structure for main screen use

#calculator will not make use of floats

#----------------------------------------------------------------------------

#main code as follows:

#global choice_selected

def main_menu():

#while choice_selected != str((“A”,“B”,“C”,“D”)):

print(“Calculator app”)

print(“Note this app ONLY functions with whole numbers! \n”)

print(“Main Menu:\n”)

print(“This is a basic calculator app\n”.center(50))

print(“A) Addition \n”)

print(“B) Subtraction \n”)

print(“C) Multiplication \n”)

print(“D) Division \n”)

global choice_selected

choice_selected=(input("please make your operator selection by choosing from the menu: ").upper())

option_selected()

def option_selected(choice_selected):

#return(str(choice_selected).upper())

if choice_selected==A:

addition_operator()

elif choice_selected==B:

subtraction_operator()

elif choice_selected==C:

multiplication_operator()

elif choice_selected==D:

division_operator()

else:

print(“Error Value entered not recognized in system, please make a selection from the given values.”)

def addition_operator():

print(“Addition Selected.”)

Value_1=(int(input(“enter first integer for the addition problem.”)))

Value_2=(int(input(“enter second integer to be added.”)))

print("the sum of these two integers is: ",Value_1+Value_2)

def subtraction_operator():

print(“Subtraction selected.”)

Value_1=(int(input(“Enter the first integer to be Subtracted.”)))

Value_2=(int(input(“Enter the second integer that will subtract.”)))

print("The Difference between these two numbers is: ",Value_1-Value_2)

def multiplication_operator():

print(“Multiplication selected.”)

Value_1=(int(input(“Enter the first integer to be multiplied.”)))

Value_2=(int(input(“Enter the integer to be multiplied by.”)))

print("The Product of these two numbers is: ",Value_1*Value_2)

def division_operator():

print(“Devision selected.”)

Value_1=(int(input(“Enter the integer to be Devided.”)))

Value_2=(int(input(“Enter the ammount to Devide by.”)))

print("The quotient of these two numbers is: ",Value_1%Value_2)

main_menu()

option_selected()