On Tue, Oct 4, 2011 at 10:03 PM, lina <[email protected]> wrote:
> > > On Tue, Oct 4, 2011 at 8:51 PM, <[email protected]> wrote: > >> I don't understand what you want >> >> Mayybe give expected output as well >> > > want to do a statistic of the concurrence of E, > namely, > how many times the E showed up, > > so the first column is 1, second column and then following. > > Thanks, > > I have one, which showed something like: > > > > tokens=['E'] > > result=[] > filedata = open("try.xpm") > text=filedata.readlines() > > for line in text: > result.append({t:line.count(t) for t in tokens}) > > for index,r in enumerate(result): > print(index,"-----",r) > > The error message is: > > > result.append({t:line.count(t) for t in tokens}) > ^ > SyntaxError: invalid syntax > I made a mistake, it used python3 I wonder: can someone help me anatomy this one to help me understand, > > > >> >> Sent from my Verizon Wireless BlackBerry >> >> -----Original Message----- >> From: lina <[email protected]> >> Sender: [email protected] >> Date: Tue, 4 Oct 2011 19:44:02 >> To: tutor<[email protected]> >> Subject: [Tutor] arrary stastic >> >> _______________________________________________ >> Tutor maillist - [email protected] >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor >> >> >> > > > -- > Best Regards, > > lina > > > -- Best Regards, lina
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
