18 lines
507 B
Python
18 lines
507 B
Python
import csv
|
|
|
|
with open('movies.csv', 'r', encoding='utf-8') as f:
|
|
reader = csv.DictReader(f)
|
|
|
|
print('评分高于9.5的电影:')
|
|
print('-' * 40)
|
|
|
|
count = 0
|
|
for row in reader:
|
|
if float(row['rating']) > 9.5:
|
|
count += 1
|
|
print(f"{row['rank']}. {row['title']}")
|
|
print(f" 英文名: {row['en_title']}")
|
|
print(f" 评分: {row['rating']}")
|
|
print()
|
|
|
|
print(f'共 {count} 部评分超过9.5') |