Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginners question
#2
To make a variable part of the object. You have to put self in front of it.
self.prot = 'class'
Otherwise it a local variable.

You also misspelled strength.

line 24 could also do.
while(self.prot not in ['warrior', 'priest', 'thief', 'mage']):
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
Beginners question - by Youmanity - Mar-21-2018, 11:40 AM
RE: Beginners question - by Windspar - Mar-21-2018, 12:49 PM
RE: Beginners question - by Youmanity - Mar-21-2018, 01:10 PM
RE: Beginners question - by Windspar - Mar-21-2018, 01:37 PM
RE: Beginners question - by Youmanity - Apr-08-2018, 07:02 PM

Forum Jump:

User Panel Messages

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