/ LEARNING, PROGRAMMING, COMPUTER

Easy Calculations With Python

The Reason we Code is to solve Problems

. © elementthemes.com

Programming is not all about Mathematics, it’s about solving problems we face in our daily life, and doing so we sometimes need Mathematics.

© progressiveteacher.in

So let’s do some simple Mathematics with Python, we’ve chosen Python because it’s easy to learn and has a clear syntax.

I recommend reading my previous article about starting with python https://palash.tk/Simple-Introduction-To-Python-Programming, read that before going further if you’re new to Programming or Python

So let’s start..

Start Python

If you’ve python installed locally run IDLE otherwise use online interpreter like Repl.It

If You’ve Opened IDLE or Other REPL you’ll see a prompt like this,

>>>

If you’re using Repl.It, on the right pan you’ll also see a prompt like

>

If nothing wrong happened, goto the next chapter. If you find any problems please comment below the article, I’ll surely help you

Simple Calculations With Python 👀

If you’ve successfully completed the previous chapter, now you have a >>> or > prompt on your screen.

In the >>> type 1+2 and press enter. If you’ve done everything correctly you’ll see a output of 3

Try other,

  • Addition , >>> 1 + 30 + 2 You’ll get 33

  • Subtraction, >>> 9-8 You’ll get 1

  • Multiplication , >>> 9 * 11 You’ll get 99

  • Division , >>> 444/2 You’ll get 222.0

Let’s Do a Complex Calculation ✊

(123456789 + 987654321) * 8

Looking for the answer?

I’ll not tell you, find Yourself using Python 😉 if you’re able to find it , comment your answer below in the comment box 👇.

That’s the fun of Programming 😁