kearney

自学还没成才的python猿

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2017年6月13日

摘要: #剪刀、石头、布 import random guess_list = ["石头", "剪刀", "布"] win_combination = [["布", "石头"], ["石头", "剪刀"], ["剪刀", "布"]] while True: people = input('请输入:石头,剪刀,布\n').strip() computer = random.choic... 阅读全文
posted @ 2017-06-13 18:06 Gino森 阅读(688) 评论(0) 推荐(0) 编辑

摘要: 题目: a,b,c,d 4名为犯罪嫌疑人,有一名是小偷,其中3个人说的是实话,一个人说的是假话,编程推断谁是小偷。 a说我不是小偷 b说c是小偷 c说小偷肯定是d d说c胡说! 阅读全文
posted @ 2017-06-13 16:25 Gino森 阅读(812) 评论(0) 推荐(0) 编辑

摘要: # coding:utf-8 with open('dist_1.txt','r',encoding= 'utf-8') as f1,open('dist_2.txt','w',encoding= 'utf-8') as f2: i=0 for line in f1: i+=1 if i%10==0: ... 阅读全文
posted @ 2017-06-13 14:47 Gino森 阅读(238) 评论(0) 推荐(0) 编辑