Python不使用int()函数把字符串转换为数字 2018年05月21日 14:18:45 边缘ob边缘ob 阅读数:1035 https://blog.csdn.net/qq_33192555/article/details/80391554 方法一:利用str函数 既然不能用int函数,那我们就反其道而行,用str函数找出每一位字符表示的数字大写. def atoi(s): s = s[::-1] num = 0 for i, v in enumerate(s): for j in r
Python 基础:字符串,数字,变量 1. 字符串 (信息的一种表达方式) a. 使用引号创建字符串 b. 单引号,双引号,三引号: ', ", ''', """ c. print函数: print('hello', end=',');print('world', end=';') d. 和字符串显示格式相关的应该想到print函数,print函数可以指定不同的结束字符串. e. ascii art """ ##### #######