python 6.23
# 从 csv 文件中读取数据
import csv
f = open('data.csv', 'r')
data = list(csv.reader(f))
# print(data)
f.close()
# 找出价格大于等于 2 且价格最低的文具
min = 100
for i in data:
name = i[0]
price = float(i[1])
print(name,price)
if price >= 2:
print(price)
if min > price:
min = price
min_name = name
print(min_name, min)
Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.