How to access an array using raw_input in python
<p>So, I have a python script which requires an input from the terminal.  I have 20 different arrays and I want to print the array based on the input.</p>

<p>This is the code minus the different arrays.</p>

<pre><code>homeTeam = raw_input()

awayTeam = raw_input()

a = (homeTeam[0])+(awayTeam[3])/2
b = (hometeam[1])+(awayTeam[2])/2
</code></pre>

<p>So, effectively what I want to happen is that homeTeam/awayTeam will take the data of the array that is typed. </p>

<p>Thanks</p>

<p>You can take raw_input() as string and then you can use split function to make it array. While doing arithmetic stuff you need to do type casting.   for example,</p>

<pre><code>homeTeam = raw_input() ### 1,2,3,4
homeTeam = homeTeam.split(",")

awayTeam = raw_input() ### 5,6,7,8
awayTeam = awayTeam.split(",")

a = (int(homeTeam[0]) + int(awayTeam[3]))/2
b = (int(hometeam[1]) + int(awayTeam[2]))/2
</code></pre>

python arrays