摘要:
'''已知一组数据规律如下:1,-2,3,-4,5,-6,7,-8.......-100求出这些数字加起来的和 sum=1-2+3-4......-100'''l=[]for i in range(1,101): if i%2 ==0: l.append(-i) else: l.append(i)p 阅读全文
摘要:
def bubbleSort(arr,length): for j in range(length): for i in range(length-1): if arr[i] > arr[i+1]: arr[i],arr[i+1] = arr[i+1],arr[i] return arrif __n 阅读全文
摘要:
import pymysql# 打开数据库连接def db_insert(sql_insert): db = pymysql.connect(host='47.104.*.*', port=3308, user='root', passwd='123456', db='ernest') # 使用cu 阅读全文