摘要:
a=[[1,2,3],[4,5,6],[7,8,9]] d=[c for b in a for c in b] print(d) print("学号:2005") 阅读全文
posted @ 2024-10-28 11:37
VVV1
阅读(8)
评论(0)
推荐(0)
摘要:
L = ['abc', 12, 3.45, 'Python', 2.789] print(L) #输出完整列表 print(L[0]) #输出列表的第一个元素 L[0] = 'a' #修改列表的第一个元素 L[1:3] = ['b', 'Hello'] #修改列表的第二、三元素 print(L) L 阅读全文
posted @ 2024-10-28 11:34
VVV1
阅读(11)
评论(0)
推荐(0)
摘要:
` import numpy as np a=[] with open('data2_2.txt')as f: for (i,s)in enumerate(f): a.append([s.count('a'),s.count('c'), s.count('g'),s.count('t')]) b=n 阅读全文
posted @ 2024-10-28 11:31
VVV1
阅读(14)
评论(0)
推荐(0)
摘要:
`str1 = "Hello World!" print(str1) #输出字符串 print(str1[0:-1]) #输出第一个到倒数第2个的所有字符 print(str1[-1]) #输出字符串的最后一个字符 print(str1[2:5]) #输出从第三个开始到第五个的字符 print(st 阅读全文
posted @ 2024-10-28 11:26
VVV1
阅读(21)
评论(0)
推荐(0)
浙公网安备 33010602011771号