+ 3

Function int python

What function int in python do? I dont understand it.

24th Oct 2018, 4:50 PM
CYTRYNLORD
CYTRYNLORD - avatar
3 odpowiedzi
+ 5
Converts an object to an integer (if possible). a = '25' # string b = '2' print(a + b) # strings are concatenated # output: '252' print(int(a) + int(b)) # strings are treated as integers # output: 27
24th Oct 2018, 5:28 PM
Anna
Anna - avatar
+ 4
int function in Python convert a float number or a string to number. int(2.3) 》 2 int("44") 》 44 if you enter a integer for this function it will back a copy of your number. int(144) 》 144 you can read more here: https://docs.python.org/3/library/functions.html#int
26th Oct 2018, 12:50 PM
Mehran sanea
Mehran sanea - avatar
- 1
it converts the value with a type string to an integer
26th Oct 2018, 3:19 PM
Seniru
Seniru - avatar