标签:bsp format range mat class 代码 附加 too inpu
描述:
计算1+2+......+99+100
代码:
sum=0 for i in range(101): sum=sum+i print("1+2......+99+100={}".format(sum))
描述:
猜数游戏
代码:
import random num=random.randint(1,100) _input=1 while(_input!=0): _input=eval(input("input a num (1-100),if you want to exit,press 0:")) if(_input>num): print("too big") elif(_input<num): print("too small") else: print("right")
标签:bsp format range mat class 代码 附加 too inpu
原文地址:http://www.cnblogs.com/jiangbinggouzi/p/6665151.html