Python homework

ROGER GRAYDON CHRISTMAN dvl at psu.edu
Wed Dec 13 17:31:58 EST 2017


On Wed, Dec 13, 2017, Lorenzo Sutton wrote:
>
On 05/12/17 06:33, nick martinez2 via Python-list wrote:
>> I have a question on my homework. My homework is to write a program in
>which
>> the computer simulates the rolling of a die 50 times and then prints
>> (i). the most frequent side of the die (ii). the
>average die value of all
>> rolls. 
>
>For this kind of problem I think the collections module [1] can be very 
>useful. In this case in particular have a look at the Counter package ;)
>
>Lorenzo.
>
>[1] https://docs.python.org/3.6/library/collections.html
>
>


A nice answer at face value, and for general questions, but
perhaps not the best given the subject line and the first sentence
in the OP's note.

Counting is such a fundamental programming skill, that I expect
whoever teaches this course expects students to know how to
count, without appealing to a third-party object to do all their
work for them.   

When I teach my course, I have no desire to have
all my students turn into cargo cultists.

At least this particular student did post his intended solution,
instead of outright begging for code.  And most of the responses
I see did attempt to work within the perceived constraints 
regarding what language tools the student was expected to use.

Roger Christman
Pennsylvania State University




More information about the Python-list mailing list