Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with stripping output
#2
>>> import itertools
>>> 
>>> dcatagory1 = [' 1. AT&T  ', ' 2. FP&L  ', ' 3. WATER ', ' 4. GAS   ', ' 5. PLAN-D']
>>> dcatagory2 = [' 6. AARP  ', ' 7. DIAZ  ', ' 8. DRUGS ', ' 9. HOUSE ', '10. CAR   ', '11. MISC  ']
>>> for item in itertools.chain(dcatagory1, dcatagory2):
...     print(item.strip())
...     
1. AT&T
2. FP&L
3. WATER
4. GAS
5. PLAN-D
6. AARP
7. DIAZ
8. DRUGS
9. HOUSE
10. CAR
11. MISC
Look again at Linux Python 3 environment
So you can at least use Python 3.5 that comes with Mint 18.2.
Mint 19 has Python 3.6.5 as default.
Reply


Messages In This Thread
Help with stripping output - by oldcity - Oct-26-2018, 03:55 PM
RE: Help with stripping output - by snippsat - Oct-26-2018, 04:19 PM
RE: Help with stripping output - by oldcity - Oct-27-2018, 05:40 PM
RE: Help with stripping output - by snippsat - Oct-27-2018, 06:23 PM
RE: Help with stripping output - by oldcity - Oct-27-2018, 10:24 PM
RE: Help with stripping output - by snippsat - Oct-28-2018, 04:58 AM
RE: Help with stripping output - by oldcity - Oct-28-2018, 07:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Stripping numbers from text ebolisa 4 1,521 Jul-18-2022, 06:59 PM
Last Post: deanhystad
  Looking for simple help - text file stripping DerekK 1 2,182 Mar-08-2019, 10:06 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020