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>Since your stats seem to be separated by a whitespace delimiter, you can use <code>str.split()</code> to separate each of your stats into a list. here is a demo:</p>

<pre><code>stats = "Djokovic:Murray:2-6,6-7,7-6,6-3,6-1 Murray:Djokovic:6-3,4-6,6-4,6-3"

def compile_stats(stats):
    stats_lst = list(stats.split(" ")) # using str.split to 
    # split the string every time whitespace is found.
    return stats_lst 


print(compile_stats(stats)) 
# output:['Djokovic:Murray:2-6,6-7,7-6,6-3,6-1', 'Murray:Djokovic:6-3,4-6,6-4,6-3']
</code></pre>

<p>It takes each stat, and makes it its own separate list item.</p>

python python-2.7 python-3.x