0

Can someone tell me what character this is in python as I am unable to remove it from the list. I've split the list on the new line character and so I thought it was associated with that but I believe that splitting on something removes it from being in the list. When I try to remove the characters using the literal presented to me in the list I've been unsuccessful.

enter image description here

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
Normandy
  • 37
  • 1
  • 12
  • [enter image description here](https://i.imgur.com/cf5AFY6.png) – Aran-Fey Nov 18 '17 at 09:37
  • @ozgur Please don't encourage newbies to post images by inlining them. There's a reason why low-rep users can't inline images - they shouldn't be there in the first place. – Aran-Fey Nov 18 '17 at 09:41
  • So I try this the method that was listed in the flagged duplicate question but when I do this and print out the list I get None back. I would add a picture but you seem to be opposed to that so... – Normandy Nov 18 '17 at 09:45
  • We don't need to see a picture of `None`, we all know what that is. If anything, we need to see your code - and not as picture. – Aran-Fey Nov 18 '17 at 09:47
  • import string string.punctuation def open_file(f): with open(input("Enter a file name: "),'r' ) as inf: f = inf.read() return read_data(f) def read_data(f): f = "".join(i for i in f if i not in string.punctuation) d = f.lower() d = d.strip() d = d.split('\n') print(d) – Normandy Nov 18 '17 at 09:48
  • just filter the list from empty strings? – David Bern Nov 18 '17 at 09:49
  • Perfect. The one I looked at with that code did not have filter in it and I couldn't get it to work but when filter is applied it is exact. thanks. – Normandy Nov 18 '17 at 09:52
  • @NormandyAtomBryson if that solved your problem, I would suggest that you post that as an answer to your own question. That way others searching the web will find it.. – David Bern Nov 18 '17 at 17:25

0 Answers0