摘要: 切片cc=[1,2,3,4,5,6,7,8,9,10],从这个列表中,获得[2,4,6,8,10],并将其逆序输出cc=[1,2,3,4,5,6,7,8,9,10] a=cc[1:10:2] print(a[::-1]) 使用while或for 计算1~1000 奇数和 偶数和,并分别输出 我的答案 阅读全文
posted @ 2021-01-09 08:11 1+1= 阅读(238) 评论(0) 推荐(0)
摘要: a=[1,3,5,7,9,11] bb={1:"家",2:"学校",3:"在路上"} a[2]=101 a.append(13) bb[3]="单位" print(bb) 阅读全文
posted @ 2021-01-09 08:02 1+1= 阅读(104) 评论(0) 推荐(0)
摘要: if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) form = QtWidgets.QWidget() windows = Ui_Form() windows.setupUi(form) form.show() sys 阅读全文
posted @ 2020-12-07 14:46 1+1= 阅读(72) 评论(0) 推荐(0)
摘要: #导入数据 #import numpy as np #x=np.loadtxt('文件位置',delimiter=','用什么分隔符,'skiprows=1'跳过文件第一行,'usecols=(1,2,3)'读取1,2,3列数据) #排序元组 #np.sort(元组名字) 阅读全文
posted @ 2020-09-22 17:00 1+1= 阅读(113) 评论(0) 推荐(0)
摘要: fruits = ['banana', 'apple', 'mango'] for index in range(len(fruits)):#len能取出元组中的字符串 print '当前水果 :', fruits[index] print "Good bye!" #当前水果 : banana 当前 阅读全文
posted @ 2020-09-22 16:11 1+1= 阅读(2739) 评论(0) 推荐(0)
摘要: for num in range(10,20): # 迭代 10 到 20 之间的数字 for i in range(2,num): # 根据因子迭代 if num%i == 0: # 确定第一个因子,num能被i整除 j=num/i # 计算第二个因子 print (num,"等于",i,"*", 阅读全文
posted @ 2020-09-22 15:55 1+1= 阅读(305) 评论(0) 推荐(0)
摘要: //用户输入a,b,c三条边长,判断是否能组成三角形,并打印出来 (两边之和大于第三遍) a=int(input())//强制类型转换 b=int(input())//input()用户输入一个值 c=int(input()) if a+b>c and b+c>a and a+c>b: print( 阅读全文
posted @ 2020-09-22 15:41 1+1= 阅读(127) 评论(0) 推荐(0)
摘要: cc=[1,2,3,4,5,6,7,8,9,10],从这个列表中,获得[2,4,6,8,10],并将其逆序输出 cc=[1,2,3,4,5,6,7,8,9,10] a=cc[1:10:2]//取下标为1的数开始取10个每个数相差2 print(a[::-1])//逆序输出a中的元素 阅读全文
posted @ 2020-09-22 15:38 1+1= 阅读(156) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单</title> </head> <body> <h1 align="center">注册信息</h1> <hr color="#336699"> <for 阅读全文
posted @ 2020-09-02 15:55 1+1= 阅读(151) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表格</title> </head> <body> <table border="6" width="500px" bgcolor="#f2f2f2" cell 阅读全文
posted @ 2020-08-29 11:55 1+1= 阅读(199) 评论(0) 推荐(0)