HOW TO MAKE BASIC PYTHON CALCULATOR PROGRAM – 2016

BASIC PYTHON CALCULATOR


We have to first make our own functions by the attribute def. As we are going to use the trig ratios, exponent pow and squareroot.  We have to import a module, that module is math import math
Now let’s define our functions:Basic Python Calculator
After defining our functions we have to take input from user, but before we take input from user we have to alert the user of the options available to use as below:
Basic Python Calculator
We then make a variable as above ,I named mine choice you can name yours anything you want. The variable should be take input from user which will be stored for future use.
Now after doing that, as you saw above our calculator will only hold two variable X and Y.
We have to make the x and y variables which will allow the user to enter input any number they want which will be in a FLOAT in order to obtain numbers with decimals:
X = num1
Y = num2
Basic Python Calculator
We have to include an if else and elif statement to make the code be able to execute what the user has bid for:
Basic Python Calculator
WELL DONE YOUR CALCULATOR IS COMPLETE SAVE IT AS BASICCALCULATOR.PY
Don’t worry about the last statement you can add it if you want to execute your program at the command line.
END!!!!!!!!!!!!!!!!
Download Source Code Of Basic Python Calculator : – Click here
SHARE

NetTech

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments: