Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to convert types of variablesin python

int(anyData) #any into integer
str(anyData) #any into string
ord(chr) #character into number
hex(int) #integer into hexadecimal string
oct(int) #integer into octal string
float(anyData) #any into float
tuple() #convert to tuple
set() #returns the type after converting to set
list() #convert any data type to a list
dict() #convert a tuple of order (key,value) into a dictionary
complex(real,imag) #converts real numbers to complex(real,imag) number
Comment

PREVIOUS NEXT
Code Example
Python :: catch error python 
Python :: panda categorical data into numerica 
Python :: python get directory of current script file 
Python :: small factorial codechef solution 
Python :: django models using Value 
Python :: Math Module sqrt() Function in python 
Python :: get table selenium python pandas 
Python :: Python make directories recursively 
Python :: python get element from list 
Python :: ParserError: Error tokenizing data. C error: Expected 1 fields in line 6, saw 3 
Python :: add 2 set python 
Python :: python warning 
Python :: python remove none from dict 
Python :: python plot 
Python :: smtplib not sending email 
Python :: how to check whole number in python 
Python :: resize interpolation cv2 
Python :: sort dictionary by value python 
Python :: how to know the version of python using cmd 
Python :: python change terminal name 
Python :: death stranding 
Python :: padnas drop column 
Python :: vault python client 
Python :: extend a class python 
Python :: python turtle clear screen 
Python :: how to check if an input is a string in python 
Python :: pillow rgb to grayscale 
Python :: create an environment in conda 
Python :: python convert bool to string 
Python :: how to read excel with multiple pages on pandas 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =