Python:从数组创建子字符串数组

2024-09-30 03:23:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我从一个txt文件的行中获取了一个数组。问题是我只需要这些线的末端。我对Python还很陌生,所以我不知道如何将这些概念组合起来。下面是我最好的尝试,第一部分工作,但第二部分崩溃。你知道吗

 with open("prices.txt") as f:
        readline = f.readlines()

 for seatCapacity in readline:
        seatCapacity = readline[10:]

Tags: 文件intxt概念forreadlineaswith

热门问题