Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining lists into one [duplicate]

Tags:

python

list

I am writing a small script to help out with Japanese kana memorisation. How would I combine the following lists into one? I tried as follows.

a = ["a",   "i",   "u",   "e",   "o"]
k = ["ka",  "ki",  "ku",  "ke",  "ko"]
g = ["ga",  "gi",  "gu",  "ge",  "go"]
s = ["sa",  "shi", "su",  "se",  "so"]
z = ["za",  "ji",  "zu",  "ze",  "zo"]
t = ["ta",  "chi", "tsu", "te",  "to"]
d = ["da",         "du",  "de",  "do"]
n = ["na",  "ni",  "nu",  "ne",  "no"]
h = ["ha",  "hi",  "hu",  "he",  "ho"]
b = ["ba",  "bi",  "bu",  "be",  "bo"]
p = ["pa",  "pi",  "pu",  "pe",  "po"]
m = ["ma",  "mi",  "mu",  "me",  "mo"]
y = ["ya",         "yu",         "yo"]
n = ["n"]

kana = [a, k, g, s, z, t, d, n, h, b, p, m, y, n]

print kana
like image 682
abkai Avatar asked May 03 '12 02:05

abkai


People also ask

How do I combine two lists without duplicates?

With installed Kutools for Excel, you can use the Select duplicates & unique cells function to solve the problem that combine two list without duplicates. 1. Copy one of the two lists and paste it to the bottom of the other list, select the new list, then click Kutools > Select Tools > Select duplicates & unique cells.

How do I combine multiple lists into one python?

chain() method is passed the arguments of list1, list2 and list3. This method takes multiple arguments and returns a single sequence of items. So, the chain() method concatenates all three lists. The result of the method call is converted into a list using the list() method.


1 Answers

One way:

kana = a + k + g + s + z + t + d + n + h + b + p + m + y + n
like image 171
Mark Tolonen Avatar answered Sep 27 '22 20:09

Mark Tolonen