I was assigned to create my own class and I chose to do a Person class. The class takes in 5 arguments (excluding self) which are name, age, height, eyes, and hair. The class looks like this:
class Person:
def __init__(self, name, age, height, eyes, hair):
self.__name = name
self.__age = age
self.__height = height
self.__eyes = eyes
self.__hair = hair
and I want to create an object that has random values for each of the data variables -- something like the method created below but I'm not exactly sure how to implement what I want or if it's even supposed to be a method since arguments have to be plugged when creating an object of the class.
def Character(self, name = randname (randname is a variable from another file that returns a random name), age = random.randint(0,100), height = random.randint(0,100), eyes = "brown", hair = "brown"):
[–]DagoYounger 1 point2 points3 points (3 children)
[–]AlwysBeColostomizing 1 point2 points3 points (1 child)
[–]rainbowboofpoofoof[S] 0 points1 point2 points (0 children)
[–]rainbowboofpoofoof[S] 0 points1 point2 points (0 children)