Re: [Tutor] Printing a list count - Help

2014-08-30 Thread boB Stepp
On Fri, Aug 29, 2014 at 2:17 PM, Derek Jenkins wrote: > Hi everybody, > > I have a list that I want to go through and finally print a total > count of particular items. In this case, I want to print the result of > how many A's and B's are in the list. > > honor_roll_count = 0 > student_grades = [

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Alan Gauld
On 29/08/14 20:17, Derek Jenkins wrote: Hi everybody, I have a list that I want to go through and finally print a total count of particular items. In this case, I want to print the result of how many A's and B's are in the list. honor_roll_count = 0 student_grades = ["A", "C", "B", "B", "C", "A

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
Alex, Thanks for taking this one step further! I do appreciate it... +1 On Fri, Aug 29, 2014 at 3:48 PM, Alex Kleider wrote: > On 2014-08-29 12:17, Derek Jenkins wrote: >> >> Hi everybody, >> >> I have a list that I want to go through and finally print a total >> count of particular items. In th

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
honor_roll_count = 0 student_grades = ["A", "C", "B", "B", "C", "A", "F", "B", "B", "B", "C", "A"] for grades in student_grades: if grades == "A" or grades == "B": honor_roll_count = honor_roll_count + 1 print honor_roll_count That works more to my liking. Thanks a million, Danny an

Re: [Tutor] Printing a list count - Help

2014-08-29 Thread Danny Yoo
> > The above code prints 8 lines, each being an entry for which item in > the list was either A or B. Again, I'm looking for the result to be > the number 8 itself - the total number of instances that A or B occurs > in the list. Hi Derek, Hint: the code currently prints a variable within the l

[Tutor] Printing a list count - Help

2014-08-29 Thread Derek Jenkins
Hi everybody, I have a list that I want to go through and finally print a total count of particular items. In this case, I want to print the result of how many A's and B's are in the list. honor_roll_count = 0 student_grades = ["A", "C", "B", "B", "C", "A", "F", "B", "B", "B", "C", "A"] for grad