python刷题
PTA--主要是总结别人的经验
qq_25871537
这个作者很懒,什么都没留下…
展开
-
Python刷题速成
本文链接 # 用井字符开头的是单行注释 """ 多行字符串用三个引号 包裹,也常被用来做多 行注释 """ #################################################### ## 1. 原始数据类型和运算符 #################################################### # 整数 3 # =&...转载 2020-04-30 09:15:59 · 194 阅读 · 0 评论 -
py刷题(三)
# 5 - 6 #输入一个列表,去掉列表中重复的数字,按原来次序输出! """可以用replace去掉【】""" lst = input() lst_ = [] lst = lst.replace("[", "") lst = lst.replace("]", "") lst = lst.replace(",", "") for i in lst: if i not in lst_: ...原创 2020-03-29 22:54:53 · 274 阅读 · 0 评论 -
py刷题(二)
# 3 - 7 n = int(input()) lst = list(map(int,input().split())) max = lst[0] index = 0 for i in range (1,len(lst)): if (max < lst[i]): max = lst[i] index = i print('{} {}'.format(...原创 2020-03-29 22:47:50 · 292 阅读 · 0 评论 -
py刷题
# 1-2 ***** # 在同一行依次输入三个值a,b,c,用空格分开,输出b*b-4*a*c的值 a,b,c = input().split() a,b,c = eval(a),eval(b),eval(c) # eval代替int float d = b*b-4*a*c print(d) # 1-1 # 本题目要求读入2个整数A和B,然后输出它们的和。 """ 这是回车分隔 a=i...原创 2020-03-29 22:44:45 · 612 阅读 · 0 评论