Name

int()

Examples
# Convert floating point number             
f = 65.8                                 
i = int(f)                                  
print(f) # Prints 65
																						
# Convert from string                       
s = "1234"                                  
i = int(s)                                  
print(i) # Prints 1234
																						
# Convert from string with base             
s = "1234"                                  
i = int(s, 16) # base 16 (hexidecimal)   
print(i) # Prints "4660" 
Description
Syntax
	int(value)
int(value, base)
Parameters
value
base
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License