(Mar-17-2017, 08:59 PM)buran Wrote: would you like to elaborate further on this assignment, e.g. what getAge and getName are expected to do. This looks like homework, so better say so and provide the full assignment.
in your implementation right now these methods SET new age and name for player. Is that what your intent is? or they are supposed to RETURN the name/age. Also using getters is not necessary in case like this.
http://www.practicepython.org/exercise/2...input.html
I'm teaching myself python. That exercise interested me and I felt like I was ready to give it a shot.
I got stuck, so I found a forum on python
________________________
nilamo
Ok, so you define a class, but never create an instance of it.
class player1
should probably be the first couple lines, and then your main()
would look a little like:dan = player1("gibroni", 83) dan.getName("...gibroni?")name.player1 and age.player1 are... backwards.
name
doesn't have a player1
, but player1
does have a name
.______________________
Thank you, I'll try that.. good info