how get input of multiple lines
<p><strong>I have written code to take input as list of string</strong></p>

<pre><code>d=["","","","","","","","","",""]
i=0
while(True):
  s=input()
  d[i]=s
  i=i+1
  if s=="":
    break
</code></pre>

<p>But I am not able to process list <code>d</code> to obtain required output.
<code>d[0]</code> is storing <code>Djokovic:Murray:2-6,6-7,7-6,6-3,6-1</code>. Now I want to process this string (or convert it into a dictionary)</p>

<p>Now I am able to write code (by using <code>str.split(",")</code> function) to calculate; </p>

<ul>
<li>Number of best-of-5 set matches won</li>
<li>Number of best-of-3 set matches won</li>
<li>Number of sets won</li>
<li>Number of games won</li>
<li>Number of sets lost</li>
<li>Number of games lost</li>
</ul>

<p>Is this what you are after?</p>

<pre><code>&gt;&gt;&gt; d=[]
&gt;&gt;&gt; while(True):
...   s=raw_input()
...   if s=="":break
...   temp = [s]
...   d.append(temp)
... 
a,b,7-6,7-6,6-3
c,d,7-4,7-6,6-2
e,f,6-4,7-6,6-2

&gt;&gt;&gt; d
[['a,b,7-6,7-6,6-3'], ['c,d,7-4,7-6,6-2'], ['e,f,6-4,7-6,6-2']]
</code></pre>

<p>This makes a list item out of the input and then appends that list to your main list <code>d</code><br>
You now should be able to process <code>d</code>    </p>

<p>Edit:    </p>

<p>If you persist in using 2 delimiters both <code>:</code> and <code>,</code> you are making life more difficult for yourself, Stick with one!<br>
Revising the simple code above:     </p>

<pre><code>d=[]
while(True):
    s=raw_input()
    if s=="":break
    temp = [s]
    d.append(temp)              #d becomes a list of lists
for item in d:                  #process individual lists in d
    x=item[0].split(",")        # break up the list using the delimiter comma
    for i in range(0,len(x)):   #access each item in x
        print x[i]
</code></pre>

<p>Input:<br>
Djokovic,Murray,2-6,6-7,7-6,6-3,6-1<br>
Bloggs,Smith,2-6,6-7,7-6,6-3,6-3<br>
Jones,Abernathy,6-3,6-3,6-3    </p>

<p>Output:</p>

<pre><code>Djokovic    
Murray
2-6
6-7
7-6
6-3
6-1
Bloggs
Smith
2-6
6-7
7-6
6-3
6-3
Jones
Abernathy
6-3
6-3
6-3
</code></pre>

python python-2.7 python-3.x