Two list with string. Pick random from each list and fuse them together with %s in Python
<p>I have 2 list defined:</p>

<pre><code>    lunchQuote=['ska vi ta %s?','ska vi dra ned till %s?','jag tÃ¤nkte kÃ¤ka pÃ¥ %s, ska du med?','PÃ¥ %s Ã¤r det mysigt, ska vi ta dÃ¤r?']

lunchBTH=['thairestaurangen vid korsningen','det Ã¤r lite mysigt i fiket jÃ¤mte demolabbet','Indiska','Pappa curry','boden uppe pÃ¥ parkeringen'
,'BergÃ¥sa kebab','Pasterian','Villa Oscar','Eat here','Bistro J']
</code></pre>

<p>And as you can see in the first list I wanna use the %s to bind to of the strings of each list together to a new string that I can send back to the program.</p>

<p>One example of a successful new string could be:</p>

<pre><code>ska vi ta thairestaurangen vid korsningen?
</code></pre>

<p>The problem is I don't really understand how it works with %s and what I have to do before I can use it. I worked with .format before but then just on a regular string, not strings from two different lists.</p>

<p>I have started with saving the randomly selected choices and save them in a variable:</p>

<pre><code> lunchQuote = random.choice(lunchQuote)
        BTH = random.choice(lunchBTH)
</code></pre>

<p>What should I do next?</p>

<p>The best way is using <code>format</code> method, defining <code>lunchQuote</code> as follow</p>

<pre><code>import random

lunchQuote=['ska vi ta {}?', 'ska vi dra ned till {}?', 'jag tÃ¤nkte kÃ¤ka pÃ¥ {}, ska du med?', 'PÃ¥ {} Ã¤r det mysigt, ska vi ta dÃ¤r?']

lunchBTH=['thairestaurangen vid korsningen', 'det Ã¤r lite mysigt i fiket jÃ¤mte demolabbet', 'Indiska', 'Pappa curry', 'boden uppe pÃ¥ parkeringen', 'BergÃ¥sa kebab', 'Pasterian','Villa Oscar', 'Eat here', 'Bistro J']

lunchQuote = random.choice(lunchQuote)
BTH = random.choice(lunchBTH)

print(lunchQuote.format(BTH))
</code></pre>

<p>You can use also <code>%s</code> as follow:</p>

<pre><code>import random

lunchQuote=['ska vi ta %s?', 'ska vi dra ned till %s?', 'jag tÃ¤nkte kÃ¤ka pÃ¥ %s, ska du med?', 'PÃ¥ %s Ã¤r det mysigt, ska vi ta dÃ¤r?']

lunchBTH=['thairestaurangen vid korsningen', 'det Ã¤r lite mysigt i fiket jÃ¤mte demolabbet', 'Indiska', 'Pappa curry', 'boden uppe pÃ¥ parkeringen', 'BergÃ¥sa kebab', 'Pasterian','Villa Oscar', 'Eat here', 'Bistro J']

lunchQuote = random.choice(lunchQuote)
BTH = random.choice(lunchBTH)

print(lunchQuote % BTH)
</code></pre>

python list python-3.x