- 博客(4)
- 收藏
- 关注
原创 2020-09-27
例题4,8个教师随机入住3个房间 import random offices = [[], [], []] names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] for name in names: index = random.randint(0, 2) offices[index].append(name) for i, office in enumerate(offices): print('办公室%d有%d人。' % (i, l
2020-09-27 16:46:38
55
原创 2020-09-27
例题3购物车小程序 products = [['iphone', 6888], ['MacPro', 14800], ['小米8', 2499], ['Coffee', 31], ['book', 60], ['Nike', 699]] print('-' * 6 + ' 商品列表 ' + '-' * 6) for i, element in enumerate(products): print(i, '\t', element[0], '\t', element[1]) shoping_car
2020-09-27 15:53:22
90
原创 2020-09-27
九九乘法表 for i in range(1, 10): for j in range(1, i + 1): print('%d*%d = %d' % (j, i, i * j), end=' ') print('\n')
2020-09-27 15:29:09
49
原创 例题1猜拳小游戏
学习目标: python爬虫基础 学习内容: 例题1猜拳小游戏 学习产出: # -- codeing = utf-8 -- @Time : 2020/9/25 16:58 @Author : lmfors @File : fingerguessing.py @software: PyCharm import random while 1: computer_number = random.randint(0, 2) user_number = int(input(‘please input 0(石头)
2020-09-27 09:38:50
133
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人