Im new to python

  Kiến thức lập trình

Can someone help explain classes to me. I seem to be very lost with them for some reason.

class Player:
def init(self, weapon, health, mental, name,):
self.name = name
self.weapon = weapon
self.health = health
self.mental = mental

I keep seeing everyone use a version of this format for tracking player info. i guess my biggest question is if I ask for the players name with something like input(“what is your name?”), will it automatically fill and store it in the self.name and so on?

New contributor

Wolfy Souls is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT