In: Computer Science
Make a calculator in python that always gives an explanation when the answer is output. It must be detailed
The simple calculator program for python is given as follows:
----------------------------Code-----------------------------------------------------------------------
...
# Define again() function to ask user if they want to use the
calculator again
def again():
# Take input from user
calc_again = input('''
Do you want to calculate again?
Please type Y for YES or N for NO.
''')
# If user types Y, run the calculate() function
if calc_again == 'Y':
calculate()
# If user types N, say good-bye to the user and end the
program
elif calc_again == 'N':
print('See you later.')
# If user types another key, run the function again
else:
again()
# Call calculate() outside of the function
calculate()
---------------------------------------------------------------------------------------------------
The code is well explained by comments given by #.
----------------------------------------------Please Upvote-------------------------------------------------------------------------