Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

type conversion python

# Assuming x is an int
long(x)

# This can be done backwards, such as:
int(x)
# Keep in mind, if the long is to large for an int, it will be kept as a long.

# Another conversion includes:
float(x)

Comment

Python Type Conversion

>>> 1 + 2.0
3.0
Comment

PREVIOUS NEXT
Code Example
Python :: call matlab function from python 
Python :: python tkinter menu widget 
Python :: chatterbot python 
Python :: python pandas read_csv tsv 
Python :: creating methods in python 
Python :: check if object is array like python 
Python :: string concatenation in python 
Python :: run python script inside bash script 
Python :: python string to list of chars 
Python :: adding strings together in python 
Python :: ngnix config 
Python :: python typing list of possible values 
Python :: python how to add columns to a pandas dataframe 
Python :: re.search() 
Python :: Python Read the CSV file 
Python :: py how to replace a string in a list 
Python :: how to calculate log 10 in python 
Python :: error handling in python 
Python :: heroku python heroku port issue 
Python :: python timeit function return value 
Python :: demonstrating polymorphism in python class 
Python :: compound interest python 
Python :: run julia in p;ython 
Python :: find the sitepckages for anaconda 
Python :: clone dict python 
Python :: hex string to hex number 
Python :: django-admin startproject 
Python :: os.path.dirname(__file__) 
Python :: remove df rows if two column values are not matching 
Python :: tkinter fenstertitel 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =