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

2020年4月9日

网络通信协议和通信
摘要: 1.通信规则(建立规则) 标志发出方和接收方 通用语言和语法 传递的速度和时间 证实或确认要求 2.多协议互动时常见的计算机协议 ·消息编码 ·消息格式和封装 ·消息大小 ·消息时序 ·消息传输选项 阅读全文
posted @ 2020-04-09 11:45 默默学习的凯同学 阅读(128) 评论(0) 推荐(0)
 
 

2019年6月3日

#用户登陆(三次输错机会)且每次误时显示剩余错误次数(提示:使用字符串格式化)
摘要: #用户登陆(三次输错机会)且每次误时显示剩余错误次数(提示:使⽤字符串格式化) # i = 3 # username = "yangxiaoer" # password = "123456" # while i>=0: # name = input("请输入你的用户名:") # if name == username: # passwd = input("请输入你... 阅读全文
posted @ 2019-06-03 16:42 默默学习的凯同学 阅读(587) 评论(0) 推荐(0)
 
计算 1 - 2 + 3 ... -99 中除了88意外所有数的总和
摘要: # #计算 1 - 2 + 3 ... + 99 中除了88以外所有数的总和 # 1-2+3.。。,。+99 # i=1 # sum=0 # while i <100: # if i==88: # i += 1 # continue # elif i%2!=0: # sum=sum+i # else: # s... 阅读全文
posted @ 2019-06-03 16:04 默默学习的凯同学 阅读(910) 评论(0) 推荐(0)
 
逻辑运算
摘要: #and or not #优先级,()> not > and > or #print(2 > 1 and 1 1 and 1 6 or 2 4 or 42) # T # print(2 > 1 and 3 5 and 2 2 and 3 5 and 2 > 1 or 9 1 and 3 5 and 2 > 1 and 9 > 8 or 7 1 and 3 5 and 2 > ... 阅读全文
posted @ 2019-06-03 15:43 默默学习的凯同学 阅读(139) 评论(0) 推荐(0)
 
求1-2+3-4+5 ... 99的所有数的和
摘要: 求1-2+3-4+5 ... 99的所有数的和 # sum = 0 # count = 1 # while count < 100: # if count % 2 == 0: # sum = sum - count # else: # sum = sum + count # count += 1 # print(sum) # sum=0... 阅读全文
posted @ 2019-06-03 15:17 默默学习的凯同学 阅读(449) 评论(0) 推荐(0)
 
输出 1-100 内的所有奇数
摘要: #3、输出 1-100 内的所有奇数 #方法一: # count = 1 # while count < 101: # print(count) # count += 2 #方法二: # count = 1 # while count < 101: # if count % 2 == 1: # print(count) # count += 1 ... 阅读全文
posted @ 2019-06-03 15:13 默默学习的凯同学 阅读(1596) 评论(0) 推荐(0)
 
使用while循环输入 1 2 3 4 5 6 8 9 10
摘要: #使用while循环输入 1 2 3 4 5 6 8 9 10 count = 0 while count < 10: count += 1 # count = count + 1 if count == 7: print(' ') else: print(count) count = 0 while count < 10: ... 阅读全文
posted @ 2019-06-03 15:07 默默学习的凯同学 阅读(760) 评论(0) 推荐(0)
 
奇偶索引
摘要: content=0 s = input('请输入') for i in range(len(s)): if i%2==1 and s[i].isdigit(): content=content+1 print(content) 阅读全文
posted @ 2019-06-03 11:10 默默学习的凯同学 阅读(133) 评论(0) 推荐(0)
 
去空格
摘要: i='7 ' print(int(i))#int默认去空 s=' dsadadadfdfgd ' print(s.strip()) 阅读全文
posted @ 2019-06-03 11:04 默默学习的凯同学 阅读(98) 评论(0) 推荐(0)
 
列表小练习
摘要: li=[11,22,33,44,55,77,88,99,90] result={} for row in li: if row > 66: if 'key1' not in result: result['key1']=[] result['key1'].append(row) else: if 'key2'... 阅读全文
posted @ 2019-06-03 11:03 默默学习的凯同学 阅读(132) 评论(0) 推荐(0)
 
 
下一页

公告


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