'''
【程序94】
题目:时间函数举例4,一个猜数游戏,判断一个人反应快慢。(版主初学时编的)
1.程序分析:
2.程序源代码:
'''
if __name__ == '__main__':
import time
import random
play_it = raw_input('do you want to play it.(\'y\' or \'n\')')
while play_it == 'y':
c = raw_input('input a character:\n')
i = random.randint(0,2**32) % 100
print 'please input number you guess:\n'
start = time.clock()
a = time.time()
guess = int(raw_input('input your guess:\n'))
while guess != i:
if guess > i:
print 'please input a little smaller'
guess = int(raw_input('input your guess:\n'))
else:
print 'please input a little bigger'
guess = int(raw_input('input your guess:\n'))
end = time.clock()
b = time.time()
var = (end - start) / 18.2
print var
# print 'It took you %6.3 seconds' % time.difftime(b,a))
if var < 15:
print 'you are very clever!'
elif var < 25:
print 'you are normal!'
else:
print 'you are stupid!'
print 'Congradulations'
print 'The number you guess is %d' % i
play_it = raw_input('do you want to play it.')
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
code_test.tar.gz (96个子文件)
code_test
test_26.py 412B
test_44.py 275B
test_38.py 411B
test_81.py 310B
test_35.py 535B
test_66.py 269B
test_74.py 634B
test_90.py 610B
test_49.py 312B
test_12.py 340B
test_73.py 698B
test_85.py 1KB
test_41.py 118B
test_78.py 389B
test_58.py 260B
test_56.py 1KB
test_89.py 1KB
test_24.py 589B
test_40.py 403B
test_70.py 270B
test_3.py 418B
test_96.py 442B
test_33.py 330B
test_86.py 468B
test_57.py 245B
test_20.py 237B
test_13.py 304B
test_62.py 257B
test_6.py 181B
test_19.py 308B
test_67.py 530B
test_83.py 411B
test_95.py 677B
test_91.py 718B
test_17.py 307B
test_64.py 427B
test_71.py 344B
test_76.py 560B
test_47.py 609B
test_77.py 335B
test_94.py 390B
test_92.py 431B
test_1.py 362B
test_84.py 831B
test_87.py 329B
test_59.py 204B
test_46.py 431B
test_8.py 829B
test_25.py 667B
test_72.py 235B
test_32.py 494B
test_68.py 276B
test_23.py 583B
test_80.py 357B
test_60.py 406B
test_4.py 655B
test_50.py 246B
test_28.py 410B
test_14.py 275B
test_5.py 813B
test_65.py 569B
test_30.py 742B
test_63.py 245B
test_34.py 500B
test_11.py 435B
test_51.py 742B
test_27.py 660B
test_2.py 374B
test_16.py 448B
test_42.py 560B
test_69.py 1KB
test_55.py 401B
test_21.py 222B
test_53.py 565B
test_39.py 717B
test_36.py 782B
test_31.py 581B
test_61.py 257B
test_45.py 729B
test_82.py 194B
test_15.py 699B
test_29.py 427B
test_9.py 649B
test_88.py 588B
test_75.py 254B
test_18.py 1KB
test_43.py 259B
test_22.py 296B
test_7.py 1KB
test_54.py 178B
test_79.py 392B
test_10.py 579B
test_37.py 444B
test_48.py 512B
test_93.py 267B
test_52.py 1KB
共 96 条
- 1
资源评论
无左无右
- 粉丝: 277
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 全卷积网络基于voc2012数据集简单pytorch实现
- pycharm的一些介绍-用于更好的学习python
- 基于C++的程序设计大赛天梯赛L2答案(天梯赛)
- 基于python实现的三次样条插值和均值插值法实现
- Python语言教程2-python批量图片大小处理-多文件夹
- Python语言教程1-python批量图片重命名,将后缀某几个不想要的字去除
- Space Combat Kit 太空战斗套件Unity游戏开发插件资源unitypackage C#
- Universal Device Preview 通用设备预览Unity游戏开发插件资源unitypackage
- Paladin Anim Set 圣骑士动画集Unity游戏动作动画插件资源unitypackage
- 计算机财务管理期末考报表部分题目及答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功