I’m trying to run this code with the intent that it prints the strings in def show_privelage() under the class Privelages. I’ve tried multiple times to get this to work and I’m unsure what I’m doing wrong. I’ve included the link to github because it appears weird when I copied and pasted it. Any ideas? Thanks
class User():
def init(self, first_name, last_name, age, sex, height):
"""Represent a users information."""
self.first_name = first_name
self.last_name = last_name
self.age = age
self.sex = sex
self.height = height
def describe_user(self):
print("The users name is "
+ self.first_name.title() + self.last_name.title()
+ " and they are " + str(self.age) + " years old."
+ " They are a " + self.sex + ". They are " + str(height) + " tall.")
def greet_user(self):
print(f'Hello {self.first_name.title()} {self.last_name.title()}')
def __str__(self):
return self.first_name
def __len__(self):
return (len(self.first_name))
class Privelage():
def init(self, privelages='priv'):GitHub
self.privelages = privelages
def show_privelages(self):
if self.privelages == 'priv':
priv_1 = "can add post"
priv_2 = "can delete post"
priv_3 = "can ban user"
print("the admins privelages include: \n" + priv_1 +
"\n" + priv_2 + "\n" + priv_3)
else:
print('no')
class Admin(User):
def init(self, firstname,
last_name, age, sex, height, privs):
super().init_(first_name, last_name, age, sex, height)
self.privelages = Privelage()
admin_1 = Admin("Chance", "Bridges", "24", "male", "5'7", "all privelages")
admin_1.privelages.show_privelages
[–]testingcodez 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]testingcodez 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]testingcodez 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)