I have a code that I want to generalize in Python, and all I want is to seperate this output to send each line in a unique mail.
Thank you in advance,
Here's my code.
art = [[600, 'pet', 'small'], [300, 'pet', 'medium'], [600, 'pet', 'medium'], [200, 'pet', 'big'], [300, 'pet', 'big'], [200, 'pet', 'small'], [600, 'pet', 'big']]
art_600 =[]
art_300 =[]
art_200 =[]
for i in range(len(art)):
if art[0][0] == art[i][0]:
art_600.append(art[i])
if art[1][0] == art[i][0]:
art_300.append(art[i])
if art[-2][0] == art[i][0]:
art_200.append(art[i])
print(art_600)
print(art_300)
print(art_200)
Try to make dict and iterate through
for key in dict_:
# do your code
pass
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.