• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
伍浩源
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2018年6月20日

6.20
摘要: qFile = open("q.txt",mode="r",encoding='utf-8') qText = qFile.read() qFile.close() print(qText) replaceList = [',','.',"'",'\n'] for c in replaceList: qText = qText.replace(c,' ') print(qText) ... 阅读全文
posted @ 2018-06-20 21:44 伍浩源 阅读(200) 评论(0) 推荐(0)
 
 

2018年6月13日

6.13
摘要: def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(7,'A','B','C') 阅读全文
posted @ 2018-06-13 21:05 伍浩源 阅读(172) 评论(0) 推荐(0)
 
 

2018年5月23日

3
摘要: id = '440683199901013256' area = id[0:6] birthday = id[6:14] sex = id [-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') for i in range (12): pr... 阅读全文
posted @ 2018-05-23 20:56 伍浩源 阅读(127) 评论(0) 推荐(0)
 
2
摘要: for i in range (12): print(9800+i,chr(9800+i)) 阅读全文
posted @ 2018-05-23 20:31 伍浩源 阅读(131) 评论(0) 推荐(0)
 
 

2018年5月16日

1
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def... 阅读全文
posted @ 2018-05-16 20:49 伍浩源 阅读(159) 评论(0) 推荐(0)
 
 

2018年5月2日

猜数字游戏(文明版)
摘要: number = 9 while True: guess = int(input('请猜一个数字\n')) if guess > number: input('猜的数字大了') elif guess < number: input('猜的数字小了') else: print('猜对了') break 阅读全文
posted @ 2018-05-02 20:29 伍浩源 阅读(231) 评论(0) 推荐(0)
 
猜数字
摘要: 阅读全文
posted @ 2018-05-02 20:25 伍浩源 阅读(121) 评论(0) 推荐(0)
 
 

2018年4月25日

华摄转换
摘要: while True: a = int(input(' 摄氏度转华氏度请按 1\n 华氏度转摄氏度请按 2\n 退出请按 3\n')) if a == 1: c=float(input('请输入摄氏温度:')) f=c*9/5+32 input('{:.2f}°C转换成华氏度为{:.2f}°F'.f 阅读全文
posted @ 2018-04-25 20:47 伍浩源 阅读(305) 评论(0) 推荐(0)
 
 

2018年4月22日

理解数据类型与数学运算:求和、温度转换
摘要: a=input('请输入一个数字') b=input('请输入另一个数') sum1=int(a)+int(b) print('二数之和是:{}'.format(sum1)) a=input('请输入摄氏温度') sum1=int(a)*9/5+32 print('华氏温度是:{}'.format(sum1)) 阅读全文
posted @ 2018-04-22 13:11 伍浩源 阅读(146) 评论(0) 推荐(0)
 
输入、输出与Mad Libs 游戏
摘要: 恢复内容开始 阅读全文
posted @ 2018-04-22 13:03 伍浩源 阅读(137) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3