摘要:
#打印0-100所有的奇数oddnum=0while oddnum<1000: if oddnum%2!=0: print(oddnum) oddnum=oddnum+1 阅读全文
posted @ 2017-01-31 13:44
道高一尺
阅读(289)
评论(0)
推荐(0)
摘要:
#写一个程序,判断给到的年份是否为闰年 temp=input('请输入一个年份:') while temp.isdigit()==False: temp=input('该吃药了吧,重新输入:') year=int(temp) if ((year%4==0) and (year%100!=0)) or 阅读全文
posted @ 2017-01-31 13:43
道高一尺
阅读(334)
评论(0)
推荐(0)
摘要:
#我们来写一个猜谜小游戏 respond=input('你好呀,咱们来一个心有灵犀的小游戏吧!y or n\n') if respond=='y': temp=input('好的!那我们开始,你猜一下我现在心中想的是那个数字,0-10之间的哦:\n') time=3 import random ta 阅读全文
posted @ 2017-01-31 13:39
道高一尺
阅读(227)
评论(0)
推荐(0)
摘要:
1、input()返回始终是字符串,得到整形需要改类型 2、用四舍五入的方式取整,每个整形数+0.5 阅读全文
posted @ 2017-01-31 13:36
道高一尺
阅读(208)
评论(0)
推荐(1)

浙公网安备 33010602011771号