Integer


#1

I didn’t understand Int help me


#2

Data can take a number of different forms:

"some text"   =>  str   (string)
'some text'   =>  str   (string)

True          =>  bool  (boolean)
False         =>  bool  (boolean)

3             =>  int   (integer)

3.14          =>  float (real)

Integers are whole numbers from negative infinity through positive infinity. Natural numbers are a subset of integers sometimes referred to as counting numbers from 1 to positive infinity. Python does not distinguish between Natural and Integer.

int(3)     =>  3

int(3.14)  =>  3

int('3')   =>  3

Above we see that the int() function will convert a float to an integer, and will convert a string that looks like a number (such as the return from raw_input()) to an integer.


#3

what ? this app will help me??


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.