Pages

Friday, September 4, 2015

Python For Beginners Lesson 4 Numbers

Python Numbers

hi in this tutorial im going to teach you about numbers in python
go to start menu and type python and then you can see python IDLE its built in python editor
it can identify python data type and variables automatically.in python IDLE
type

5+5 then enter it will give out put as 10



 and also you can multiple numbers
type 20*5 it will give 100


if you type 6+4*10 it will give output as 46 but why its not 100 because it follows basic maths order
it consider maths functions as this order  (),/,*,+,-


and also you can divide numbers 19/5
answer is 3.8

 if 19//5 it will give rounded value and it will drop the decimal point

if you want remainder you have to use % mark
like 19%5 it will give remaining value 4

you can get power  or exponent like this 10*10*10 
or even get the same result easily using ** mark 

or even you can assign variable and values and add them together
sam=20
madu=10
sam+madu answer is 30

i hope you have learn something from this tutorial if you have any question please leave a comment below
have a good day








No comments:

Post a Comment