参考:Python3 Print 同一行打印显示进度条效果 参考:\r\n, \r and \n what is the difference between them? [duplicate] 参考:python的print格式化输出,以及使用format来控制. 实现思路就是不停地删除之前打印的内容,通过 '\r' 实现光标返回最前,之后会覆盖内容,没被覆盖的还会继续显示. \r (Carriage Return) → moves the cursor to the beginning of
输入一行字符,判断不同字符的数量, 分别用for循环和while循环完成 for循环 运用了字符串方法, isupper()判断是否为大写字母 islower()判断是否为小写字母 isdigit()判断是否为数字 n = input("输入一行字符:") daxie = 0 xiaoxie = 0 num = 0 other = 0 for data in n: if data.isupper(): daxie += 1 elif data.islower(): xiaoxie +=