Chinaunix首页 | 论坛 | 博客
  • 博客访问: 385630
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

发布时间:2014-11-03 12:29:46

# -*- coding: UTF-8 -*-'''【程序99】题目:有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列),  输出到一个新文件C中.1.程序分析:2.程序源代码:'''if __name__ == '__main__':    import string    fp = open('JCP099.py')    a = fp..........【阅读全文】

阅读(1462) | 评论(0) | 转发(0)

发布时间:2014-11-03 12:20:18

# -*- coding: UTF-8 -*-'''【程序98】题目:从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件“test”中保存。   输入的字符串以!结束。 1.程序分析:2.程序源代码:'''if __name__ == '__main__':    fp = open('test.txt','w')    string = input('.........【阅读全文】

阅读(1624) | 评论(0) | 转发(0)

发布时间:2014-11-03 11:16:04

# -*- coding: UTF-8 -*-'''【程序97】题目:从键盘输入一些字符,逐个把它们送到磁盘上去,直到输入一个#为止。1.程序分析:     2.程序源代码:'''if __name__ == '__main__':    from sys import stdout    filename = input('input a file name:\n')    fp = open(filena.........【阅读全文】

阅读(1316) | 评论(0) | 转发(0)

发布时间:2014-11-03 11:11:17

# -*- coding: UTF-8 -*-'''【程序96】题目:计算字符串中子串出现的次数1.程序分析:2.程序源代码:'''if __name__ == '__main__':    str1 = input('input a string:\n')    str2 = input('input a sub string:\n')    ncount = str1.count(str2)    print (ncount)&.........【阅读全文】

阅读(1279) | 评论(0) | 转发(0)

发布时间:2014-11-03 11:03:57

# -*- coding: UTF-8 -*-'''【程序94】题目:时间函数举例4,一个猜数游戏,判断一个人反应快慢。(版主初学时编的)1.程序分析:2.程序源代码:'''if __name__ == '__main__':    import time    import random        play_it = input('do you want to play it.(.........【阅读全文】

阅读(1064) | 评论(0) | 转发(0)

发布时间:2014-11-01 22:06:02

# -*- coding: UTF-8 -*-'''【程序93】题目:时间函数举例31.程序分析:2.程序源代码:'''if __name__ == '__main__':    import time    start = time.clock()    for i in range(10000):        print (i)    end = time.clock()   .........【阅读全文】

阅读(926) | 评论(0) | 转发(0)

发布时间:2014-11-01 21:47:13

# -*- coding: UTF-8 -*-'''【程序92】题目:时间函数举例21.程序分析:           2.程序源代码:'''if __name__ == '__main__':    import time    start = time.time()    for i in range(3000):        print (i)    end = time.t.........【阅读全文】

阅读(896) | 评论(0) | 转发(0)

发布时间:2014-11-01 21:28:01

# -*- coding: UTF-8 -*-''' 【程序91】题目:时间函数举例11.程序分析:2.程序源代码:'''if __name__ == '__main__':    import time    print (time.ctime(time.time()))    print (time.asctime(time.localtime(time.time())))    print (time.asctime(time.g.........【阅读全文】

阅读(1059) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册