• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
黄颖琪
博客园    首页    新随笔    联系   管理    订阅  订阅
2018年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(2,'A','B','C') 阅读全文
posted @ 2018-06-13 21:23 黄颖琪 阅读(138) 评论(0) 推荐(0)
2018年5月30日
文件操作
摘要: fr=open('12.txt',mode='r',encoding='utf-8') plaincode=fr.read() print('明文:'+plaincode) print('密文:',end='') for c in plaincode: print (chr(ord(c)+3),end='') fr = open('12333.txt',mode='r',encod... 阅读全文
posted @ 2018-05-30 21:21 黄颖琪 阅读(195) 评论(0) 推荐(0)
2018年5月23日
字符串操作
摘要: id='4401045199805230056' 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') print(ord('+')) print (chr(9800)) print (chr... 阅读全文
posted @ 2018-05-23 20:23 黄颖琪 阅读(168) 评论(0) 推荐(0)
2018年5月9日
玫瑰花 星星
摘要: import turtle turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') turtle.begin_fill() for i in range(5): turtle.forward(100) tu 阅读全文
posted @ 2018-05-09 20:51 黄颖琪 阅读(164) 评论(0) 推荐(0)
2018年5月2日
程序执行流程
摘要: import turtle turtle.shape('turtle') turtle.fillcolor('purple') turtle.begin_fill() turtle.circle(50) turtle.end_fill() myNumer=520 while True: guess=float(input('价格猜谜游戏')) if guess>myNum... 阅读全文
posted @ 2018-05-02 21:50 黄颖琪 阅读(219) 评论(0) 推荐(0)
2018年4月25日
条件语句,while循环语句:完整的温度转换程序
摘要: while True: a=(input('摄氏转华氏请按 1\n华氏转摄氏请按 2\n退出请按 3\n')) if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是{}'.format(c,f)) elif a== 阅读全文
posted @ 2018-04-25 21:36 黄颖琪 阅读(156) 评论(0) 推荐(0)
温度转换
摘要: a=input('1.摄氏转华氏 2.华氏转摄氏') if a=='1': c=input('请输入摄氏温度:') f=float(c)*9/5+32 print('{}摄氏温度转为华氏温度是{}'.format(c,f)) else: c=input('请输入摄氏温度:') f=float(c)* 阅读全文
posted @ 2018-04-25 20:36 黄颖琪 阅读(184) 评论(0) 推荐(0)
2018年4月18日
mad libs游戏
摘要: name1=input('请输入一个名字:') name2=input('请再输入一个名字:') print('一天,{}和{}相约去浪漫的土耳其,然后就去了'.format(name1,name2)) 阅读全文
posted @ 2018-04-18 20:48 黄颖琪 阅读(184) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3