[i for i in mystr[:1] if i]You have an interval in the begening in the string " domain ontologies". So when you split it, it returns an empty string as the first index. Which is None in Python. Use strip().
mystr = c.strip(' ').split()
how to remove none from the for loop
|
|
Messages In This Thread |
how to remove none from the for loop - by desul - Feb-27-2017, 01:30 PM
RE: how to remove none from the for loop - by wavic - Feb-27-2017, 01:46 PM
RE: how to remove none from the for loop - by buran - Feb-27-2017, 01:55 PM
RE: how to remove none from the for loop - by snippsat - Feb-27-2017, 02:07 PM
RE: how to remove none from the for loop - by desul - Feb-27-2017, 04:11 PM
RE: how to remove none from the for loop - by sparkz_alot - Feb-27-2017, 07:17 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
[PyKML] Loop through all Placemarks; Remove namespace | Winfried | 2 | 3,556 |
Aug-28-2020, 09:24 AM Last Post: Winfried |
|
python multiprocessing import Pool, cpu_count: causes forever loop | help to remove | Hassibayub | 0 | 1,929 |
Jun-18-2020, 05:27 PM Last Post: Hassibayub |