'Reading from file to add to list
I need to get from list(file) who is coming to party and who is not.
File looks like this:
(+) John
(?) Jake
(+) Billie
How to read that person with + is coming ?
Solution 1:[1]
file = open("your_file", "r")
c = []
for line in file:
if line[1] == '+':
c.append(line[4:].strip())
print(c)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ??? |
