Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python convert

print(str(1))  # convert number to string
print(int("1"))  # convert string to int
print(float(1))  # convert int to float
print(list('hello'))  # convert string to list
print(tuple('hello'))  # convert string to tuple
print(list((1, 2, 3)))  # convert tuple to list
print(tuple([1, 2, 3]))  # convert list to tuple
print(bool(1))  # convert a number to boolean
print(bool(0))  # convert a number to boolean
print(bool(""))  # convert a string to boolean
print(bool("data"))  # convert string to boolean
print(bin(10))  # convert an integer to a binary string
print(hex(10))  # convert an integer to a hex string
print(oct(10))  # convert an integer to an octal string
Comment

PREVIOUS NEXT
Code Example
Python :: initialize np array 
Python :: composition in python 
Python :: pandas dataframe any along row 
Python :: adfuller test in python 
Python :: python multithreading 
Python :: get the path of a module in python 
Python :: netcdf in python 
Python :: discord.py permissions 
Python :: pandas to python datetime 
Python :: wifite subsystem 
Python :: get xlim python 
Python :: pca 
Python :: sort dict of dicts by key 
Python :: pyspark read from redshift 
Python :: how to remove role from people with a reaction discord bot python 
Python :: csv read python 
Python :: Javascript rendering html 
Python :: python enumerate 
Python :: python is not clickable at point (434, 682). Other element would receive the click: 
Python :: python how to remove n from string 
Python :: pandas dataframe row names 
Python :: python command line keyword arguments 
Python :: python run bat in new cmd window 
Python :: python web framework 
Python :: while loop in python 
Python :: python encode file 
Python :: python isin 
Python :: pytorch dill model save 
Python :: while true loop python 
Python :: progress bar in python 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =