Trying to figure out the data type from the code snippet
On 30/01/19 5:12 PM, Cameron Simpson wrote:
> On 30Jan2019 04:24, Chupo <bad_n_mad at yahoo.com> wrote:
>> I am trying to figure out what data type is assigned to variable p in
>> this code snippet:
>> for p in game.players.passing():
>> ?? print p, p.team, p.passing_att, p.passer_rating()
> Well, Python comes with a type() builtin function:
> ?print type(p)
Alternately/additionally, if you ask help(p), it will reveal-all about
the "class" (of which p is an "instance") - including some answers to
your second question (and perhaps others which logically follow-on).
If these terms are unfamiliar to you, then 'the manual' reference is
(although from the code above, it would appear that you are looking at
Python 2.n!). There are plenty of other tutorials available.
Additionally, Coursera has announced a course starting this week
(U.Michigan), in Python and its classes - which can be audited for $free
or used to obtain some sort of certification...