Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No option to input
#6
(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
Reply


Messages In This Thread
No option to input - by Sp00f - Mar-17-2017, 08:37 PM
RE: No option to input - by buran - Mar-17-2017, 08:51 PM
RE: No option to input - by Sp00f - Mar-17-2017, 08:54 PM
RE: No option to input - by buran - Mar-17-2017, 08:59 PM
RE: No option to input - by Sp00f - Mar-17-2017, 09:15 PM
RE: No option to input - by nilamo - Mar-17-2017, 08:59 PM
RE: No option to input - by buran - Mar-17-2017, 09:45 PM
RE: No option to input - by Sp00f - Mar-17-2017, 09:52 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020