Number Types In Python:
Integers: They are whole/natural numbers with +/- number range.e.g: -3,-2,-1,0,1,2,3
Floating Values: Numbers with decimal values.
e.g: 7.77
Complex Values: Real numbers + Imaginary numbers.
e.g: 7 + 7XY
Boolean Values: 0 OR 1 #True OR False
Note: To find type of any number:
>>> myValue = 5 #User enter a variable value.
>>> type(myValue) #Than user search for variable type.
>>>
Operators In Python:
Unary (+,-,~)
Arithmetic (+,-,*,/,%,//,**)
Relational (==,!=,>,<,>=,<=)
Logical (and, not, or)
Bitwise (&,|,^,~,<<,>>)
Assignment (=,+=,-=,*=,/=,%=,**=,//=)
Membership (In, not in)
Identity (Is, is not)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.