Question

In: Computer Science

Make a calculator in python that always gives an explanation when the answer is output. It...

Make a calculator in python that always gives an explanation when the answer is output. It must be detailed

Solutions

Expert Solution

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-------------------------------------------------------------------------


Related Solutions

There is a special calculator that when used to add numbers up, it always rounds up...
There is a special calculator that when used to add numbers up, it always rounds up or down the number to the closest integer and ignore the decimals. For example, you want to add 1.1+2+3.6, it will show can calculate as 1+2+4, etc. Assume the error from each adding follows uniform distribution on (-0.5, 0.5). When adding 1500 numbers together, what is the probability of the absolute value of total error is greater than 15? How many numbers can you...
NPV always gives you correct decision for accepting the project. If NPV always gives us the...
NPV always gives you correct decision for accepting the project. If NPV always gives us the correct decision why should we pay attention to profitability ratios or IRR? Provide an example where one of these other ratios might change your decision on a project.
Please ANSWER ALL (explanation with or without BA 2 calculator greatly appreciated) #1. What is the...
Please ANSWER ALL (explanation with or without BA 2 calculator greatly appreciated) #1. What is the value today of a money machine that will pay $3,042.00 every six months for 11.00 years? Assume the first payment is made 5.00 years from today and the interest rate is 6.00% #2. What is the value today of a money machine that will pay $4,796.00 per year for 8.00 years? Assume the first payment is made today and that there are 8.0 total...
Answer true or false, with a brief explanation. 1. Monopolies are always bad for consumers. 2....
Answer true or false, with a brief explanation. 1. Monopolies are always bad for consumers. 2. The supply curve of a monopolist is upward sloping. 3. Monopolies charge the highest price a consumer is willing to pay, thus capturing all consumer surplus.
make a python program which forms caravan occupancy report the output should be in a table...
make a python program which forms caravan occupancy report the output should be in a table format which shows the occupants, number of caravans and the percentage. caravans with over 9 occupants are considered to be over crowded, and are to be output under a single column (>9).
Please Use C language to Make a calculator. Make sure calculator is able to take up...
Please Use C language to Make a calculator. Make sure calculator is able to take up to 5 values. Try to make calculator using simple coding As you can. Please create a simple calculator with only +, -,* and divide. It has to be able to enter any numbers (including decimals) and be able to do the following functions: +, -, divide and multiply. Please have the answers, always rounded to two decimal figures. The calculator will also have to...
For an Independent Samples T-test, what are we looking for when the output gives us the...
For an Independent Samples T-test, what are we looking for when the output gives us the significance for Levene’s test for equal variance? Which significance value do we choose and when?
##### answer in python #####picture of output and input Create customer information system as follows: Ask...
##### answer in python #####picture of output and input Create customer information system as follows: Ask the user to enter name, phonenumber, email for each customer. Build a dictionary of dictionaries to hold 10 customers with each customer having a unique customer id. (random number generated) Take the keys of the above mentioned dictionary which are customer ids and make a list. Ask the use to enter a customer id and do a binary search to find if the customer...
I dont know how to make de bruijn sequence in python. We have to print output...
I dont know how to make de bruijn sequence in python. We have to print output by following this step. 1.start with a string of n consecutive zeroes 2.append 1 to the end of the string if the n-digit suffix that would be formed this way has not already appeared in the sequence; otherwise a 0 is appended to the end of the string. 3.repeat step 2 until the length of the sequence equals 2 **n For instance, when we...
Implement in Python using stack operations. Postfix Calculator Post fix calculator • We use a stack...
Implement in Python using stack operations. Postfix Calculator Post fix calculator • We use a stack • When an operand is read, push it on statck • When an operator is read i.e +, *. /, - – Pop two from the top of the stack and apply the operator and push the result on stack if there is one value instead of two display an error message • Keep repeating until an equal sign, = is read; pop from...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT