top of page
Search
Writer's pictureAbhinaw Tripathi

Integers and Floasts in Python


Defining integers in Python is very easy. eg: answer=42 pi=3.14159 Python 3 also introduces complex numbers as a type.There is no real need to worry about types in Python.atleast not in the beginning. answer + pi = 45.14159 # Don't worry about conversion ! you can seamlessly add integers, float .pyhton does not complain about it.it will produce desired results.And to cast anything.just have to do something like this. int(pi) == 3 float(answer) == 42.0 this is needed when we really want to cast the integer and float variables. 


8 views0 comments

Recent Posts

See All

Lambda Functions in Python

So Lambda Functions are just an anonymous function.they are very simple just saves your space and time.they are useful in case of higher ...

bottom of page