work = {} #创建一个字典
one_value = (1,) #值
one_key = 1 #键
work[str(one_key)] = one_value #键值对给work字典
two_key = 2
two_value = []
two_value.append(1) #增加值
two_value.append(2)
work[str(two_key)] = two_value
three_key = 3
three_value = []
three_value.append(1)
three_value.append(2)
three_value.append(3)
work[str(three_key)] = three_value
four_key = 4
four_value = []
four_value.append(1)
four_value.append(2)
four_value.append(3)
four_value.append(4)
work[str(four_key)] = four_value
temp_five = {1,2,3,4,5} #直接给5个值的列表
five_key = 5
five_value = []
five_value.extend(temp_five) #将这5个值直接加入five_value
work[str(five_key)] = five_value
print(work)
_keys = work.keys()
keys = list(_keys)
print(keys)
one = keys[0]
one_value = work.pop(one)
print(one,one_value)
print('{} * {} = {}'.format(int(one),one_value[0], int(one) *one_value[0] ) )
two = keys[1]
two_value = work.pop(two) #删除
print('{} * {} = {}'.format(int(two),two_value[0],int(two)*two_value[0]), end= ' ')#让2x2在同一行
print('{} * {} = {}'.format(int(two),two_value[1],int(two)*two_value[1]))
#3和4略
five =keys[4]
five_value = work.pop(five)
print('%s * %s = %s' %(five, five_value[0], int(five)*five_value[0]), end = ' ')
print('%s * %s = %s' %(five, five_value[1], int(five)*five_value[1]), end = ' ')
#...
在这里插入代码片
```for i in range(1,10):
for j in range(1,i+1):
print('{}*{}={}'.format(i,j,i*j),end = ' ')
print(' ')