-6

i came across with keyword in scrapy and interested to learn about with keyword in short and simple

  • `print(*map(''.join, names), sep='\n')` – RoadRunner Jul 05 '20 at 07:53
  • 2
    @manee We collect solution to unique problems, problems that already got a solution get closed as duplicate. Thats nothing bad, just directs you to the "older" post that solves your problem. Read the duplicates answers - they solve yours. – Patrick Artner Jul 05 '20 at 07:58
  • @PatrickArtner please remove ban on this question i have changed it – maneesh sandra Jul 11 '20 at 09:05
  • @maneesh There is no "ban" on this question. It is a duplicate of other questions that answer yours. Beside that you got a perferctly fine answer below (that you already accepted). Having questions closed as Duplicate is nothing inherintly bad, it just curates the site and leads people that find your question to others that were there before yours and also answer it. See [here](https://stackoverflow.com/help/duplicates) – Patrick Artner Jul 11 '20 at 13:27
  • 1
    Beside that - you **_never ever_** change one question into something different that invalidates its already given answers. You'll invalidate all the work people took on them to help you out. Ask a new question if you have a specific question that is on-topic - see [ask] for details. That "edit" of yours does not qualify as a valid question here. – Patrick Artner Jul 11 '20 at 13:36
  • @PatrickArtner i know but due to too many demerits stackoverflow is not allowing me to post any new question. what can i do – maneesh sandra Jul 11 '20 at 16:18
  • 1
    Circumventing our rules it not helpful. Please read: https://stackoverflow.com/help/question-bans – Cody Gray - on strike Jul 12 '20 at 07:29

2 Answers2

7

You can do it like this:

names = [['N', 'I', 'T', 'I', 'N'], ['I', 'N', 'T', 'N', 'I']]

for s in map(''.join, names):
    print(s)
helloworld
  • 12
  • 11
  • Sorry got confuesed. As the inner strings all contain strings it works - if you have mixed innner lists (say `[[ 1,"hi"],["hi",2]]` - it won't because `''.join(iterable)` wants strings only). – Patrick Artner Jul 05 '20 at 07:56
  • @PatrickArtner yes, in that case you can call `str()` first. – helloworld Jul 05 '20 at 07:58
1
names = [['N', 'I', 'T', 'I', 'N'], ['I', 'N', 'T', 'N', 'I']]
formatted = [''.join(name) for name in names]
print(*formatted, sep='\n')
kingkupps
  • 3,284
  • 2
  • 16
  • 28