Python
@萌橙开心
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python 中如何实现多组的输入输出
多组数据的输入: while True: try: a,b,c=map(int,input().split()) print(a+b+c) except: break 实现特定的次数的输入: n=int(input()) print (n,type(n)) i=0 while i < n: a,b,c=map(...原创 2019-05-07 20:06:01 · 12514 阅读 · 2 评论 -
Python 中的取余与取整操作
%: 对于正数的取余操作,跟其他的语言没有什么区别,在这里重点说一下负数的取余: print (-5%3) #输出 1 #仅有一负号时,在负无穷到-5之间找到一个数能被3整数,最接近于-5的数是-6,所以-5 - (-6) print (5%-3) #输出-1 #仅有一负号时,在5到正无穷之间找到一个数能被-3整数,最接近于5的数是6,所以5 - 6 // : 这个是取整符...原创 2019-05-07 21:00:13 · 16671 阅读 · 1 评论
分享