<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle">P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div align="left"><font face="Courier New"><span>HELP! Hi I'm a newbie in Python, I'm having trouble organizing the <font style="BACKGROUND-COLOR: #ffff00">FILE</font> into the
<font style="BACKGROUND-COLOR: #ffff00">OUTPUT</font> BELOW. I put the file into read, then I put it on a list, and my plan is to put the name and the corresponding grades into a dictionary, using the elements on the list, but when I print the dictionary, it's
not giving me the result I wanted. <font style="BACKGROUND-COLOR: #ffff00">MY CODE SO FAR IS SHOWN BELOW THE OUTPUT</font>. For more details of the assignment, go to this link
<a href="http://ranger.uta.edu/~kamangar/Courses/CSE_1310_FA12/Homework5(DueDate.Oct.16,2012).html#Topic18">
http://ranger.uta.edu/~kamangar/Courses/CSE_1310_FA12/Homework5(DueDate.Oct.16,2012).html#Topic18</a> Thank you so much.</span></font></div>
<div align="left"><font face="Courier New"><span><br>
</span></font><font style="BACKGROUND-COLOR: #ffff00" face="Courier New"><span>FILE</span></font></div>
<div align="left"><font face="Courier New"><span></span></font> </div>
<div align="left"><font face="Courier New"><span>HM3, 80 , HM2 ,90 , ID, 1000123456,HM4,92,Last_name,Rubble</span></font></div>
<div align="left"><font face="Courier New"><span>ID, 1000100200,Last_name,Bunny,HM2,92,HM5,70,HM1,98,</span></font></div>
<div align="left"><font face="Courier New"><span>ID, 1000123300,HM1,86, HM3,100,Last_name,Duck</span></font></div>
<div align="left"><font face="Courier New"><span>HM4,96,Last_name,Chipmunk,HM1,86,ID,1000456456</span></font></div>
<div align="left"><font face="Courier New"><span>Last_name,Simpson,HM3,70, HM1, 90 ,ID, 1000321321,Test1,90</span></font></div>
<div align="left"><font face="Courier New"><span>HM1,87,Last_name,Duck,HM2, 100 ,HM4,94,ID, 1000123300</span></font></div>
<div align="left"><font face="Courier New"><span>HM3,95,HM2,88,Last_name, Chipmunk ,HM1,86 , ID,1000999888</span></font></div>
<div align="left"><font face="Courier New"><span>HM1, 92 ,Last_name,Simpson,ID, 1000321321,HM2,90</span></font></div>
<div align="left"> </div>
<div align="left">
<div align="left"><font style="BACKGROUND-COLOR: #ffff00" face="Courier New"><span>OUTPUT</span></font></div>
<div align="left"><font face="Courier New"><span></span></font> </div>
<div align="left"><font face="Courier New"><span>Name | ID | HM1 | HM2 | HM3 | HM4 | Avg. |</span></font></div>
<div align="left"><font face="Courier New"><span>___________________________________________________________________</span></font></div>
<div align="left"><font face="Courier New"><span>Bunny | 1000100200 | 98 | 92 | 0 | 0 | 47.50 |</span></font></div>
<div align="left"><font face="Courier New"><span>Chipmunk | 1000456456 | 86 | 0 | 0 | 96 | 45.50 |</span></font></div>
<div align="left"><font face="Courier New"><span>Chipmunk | 1000999888 | 86 | 88 | 95 | 0 | 67.25 |</span></font></div>
<div align="left"><font face="Courier New"><span>Duck | 1000123300 | 87 | 100 | 100 | 94 | 95.25 |</span></font></div>
<div align="left"><font face="Courier New"><span>Rubble | 1000123456 | 0 | 90 | 80 | 92 | 65.50 |</span></font></div>
<div align="left"><font face="Courier New"><span>Simpson | 1000321321 | 92 | 90 | 70 | 0 | 63.00 |</span></font></div>
<div align="left"><font face="Courier New"><span></span></font> </div>
<div align="left"><font face="Courier New"><span>
<div align="left"><font style="BACKGROUND-COLOR: #ffff00" face="Courier New"><span>THIS IS MY CODE SO FAR</span></font></div>
<div align="left"><font face="Courier New"><span></span></font></div>
<div align="left"><font face="Courier New"><span>filename = open("student_grades_hm_5.txt")<br>
infile = filename.read()<br>
mix_list = infile.split()</span></font></div>
<div align="left"><font face="Courier New"><span></span></font></div>
<div align="left"><font face="Courier New"><span></span></font></div>
<div align="left"><font face="Courier New"><span>print "Name | ID | HM1 | HM2 | HM3 | HM4 | Avg. |"<br>
print "______________________________________________________"</span></font></div>
<font face="Courier New"><span>
<div align="left"><br>
Student_one = {"Name":mix_list[9],"ID":mix_list[5],"HM1":0,"HM2":mix_list[3],<br>
"HM3":mix_list[1],"HM4":mix_list[7]}</div>
<div align="left">print Student_one</div>
</span></font></span></font></div>
<div align="left"><font face="Courier New"><span></span></font> </div>
<div align="left"></div>
</div>
</div>
</body>
</html>