ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# Python代码 99乘法表 ~~~ for i in range(1,10): for y in range(1,i+1): msg = '{0}*{1}={2}'.format(i,y,i*y) print(msg,end='\t') print() ~~~ 冒泡排序 ![](https://img.kancloud.cn/15/43/1543c0b97237bb55063e033959706ca0_801x315.gif) ~~~ a = [9,2,3,1,6,7,0] # 确定循环次数为 列表长度-1次 times = len(a) -1 while times > 0: for i in range(times): if a[i] < a[i+1]: a[i],a[i+1]=a[i+1],a[i] times = times -1 print(a) ~~~