Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 267 Bytes

string_to_number.md

File metadata and controls

25 lines (17 loc) · 267 Bytes

string to number or number to string in python

string to number

int:

num = '10'
int(num) # 输出 10

float:

num = '10.5'

# convert the num into string
converted_num = float(num)

number to string

str(10) # '10'