摘要: range()函数的基本语法 range()函数用于生成一个指定范围内的数字序列,其基本语法如下: range(start, stop, step) Python start:可选参数,表示起始数字(默认为0)。 stop:必填参数,表示终止数字,不包括该数字。 step:可选参数,表示步长(默认为 阅读全文
posted @ 2025-10-13 14:40 s1mple5678 阅读(2) 评论(0) 推荐(0)
摘要: 当不知道读入的具体行数时,可以采用如下方法一次性读取所有行: ··· from sys import stdin for line in stdin.readlines(): print(line.strip()) ··· strip()是为了去掉行末的回车 阅读全文
posted @ 2025-07-29 09:43 s1mple5678 阅读(2) 评论(0) 推荐(0)
摘要: 每个字符对应一个ascll值 A=a-(a-A) 阅读全文
posted @ 2025-06-19 18:10 s1mple5678 阅读(3) 评论(0) 推荐(0)