Pages

Wednesday, November 29, 2017

Calculating using Python

Calculating using Python 3.6.3

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. Today I will show how to use Python as a Calculator and show some interesting features as well.
"The Interpreter (software) acts as a simple calculator: you can type an expression at it and it will write the value. Expression syntax is straightforward: the operators +, -, * and /  and parentheses (()) can be used for grouping," (Guido Van Rossum 3.1). Here is a line from the book showing each of these expressions.
Here are my expressions
For any expression written that would have a decimal throughout the solving of the expression or the answer itself. They will always return a floating point number. 

I would suggest practicing the basics as when you learn them you can interpret more advanced expressions for example: I turned 25 Kilograms into how much it weighs in stone!

My question for all of you guys is "Have you tried any computer languages? which ones?" 

Michaels, Evan. Rossum, Guido Van. Learning Python. Python Software Foundation, 2001-2017


4 comments:

  1. Nope. Sorry. Nice work here though and what a great skill to develop.

    ReplyDelete
    Replies
    1. Thank you for your reply! It is okay if you have not tried any computer languages you still use them on a day to day basis and that is from folders! Folders in your computer correlate with a program called powershell!

      Delete
  2. Python seems like a very simple programming language compared to others. I've also just started programming with Java, and anything from defining an integer has a complicated syntax. From my personal experience, I tried to create a program that could compute the area of a triangle given three sides. But Java simply did not want to cooperate as easily python seems to; I had to import an obscure scanner class and watch a tutorial to understand how to use it. I think I'll switch to python after I complete my IRP.

    ReplyDelete
    Replies
    1. I find Python an easier language to use and makes faster ways to create programs. You should definitely try out Python, it is fun to work with and is more forgiving than any other languages I know personally. Have you made the program on Java, and has it worked?

      Delete