Files
task-2-4-regular-expression/hh.py
2026-04-02 15:50:30 +08:00

22 lines
636 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 模拟豆瓣Top250数据本地数据无需联网
movie_data = [
("肖申克的救赎", "9.7"),
("霸王别姬", "9.6"),
("阿甘正传", "9.5"),
("泰坦尼克号", "9.4"),
("盗梦空间", "9.4"),
("这个杀手不太冷", "9.4"),
("星际穿越", "9.4"),
("千与千寻", "9.3"),
("楚门的世界", "9.4"),
("蝙蝠侠:黑暗骑士", "9.1"),
("触不可及", "9.3")
]
# 遍历打印前10条
count = 0
for title, rating in movie_data:
print(f"{count + 1}. {title} - 评分: {rating}")
count += 1
if count >= 10: # 只取前10条
break