Last updated 2 years ago
# 方法1: 基于list的索引操作 with open("demo.txt", "r") as f: data = f.readlines() print(data) a = data[0][:-1