2022年1月18日

golang 常用数据类型转换

摘要: str ↔ int num := 123 num2Str := strconv.Itoa(num) fmt.Printf("%T", num2Str) str := "12345" str2Int, _ := strconv.Atoi(str) fmt.Printf("%T", str2Int) s 阅读全文

posted @ 2022-01-18 17:09 进击的davis 阅读(82) 评论(0) 推荐(0) 编辑

python中各数据类型的转换-整型/浮点型/str型/char型/list型/dict型

摘要: str → int/float/list # 整型数字的字符串转化为数字 int/float strInt = "123" # str -> int strInt2Int = int(strInt) # str -> float strInt2Float = float(strInt) # 小数的字 阅读全文

posted @ 2022-01-18 16:39 进击的davis 阅读(1191) 评论(0) 推荐(0) 编辑

导航