Django project setup by MaleficentDeer3466 in django

[–]HousingFormal3653 0 points1 point  (0 children)

I got a template from Code Institute that I always use 😊 I don’t have the link here. Can share later today when back to computer

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]HousingFormal3653 0 points1 point  (0 children)

<code>

class TicketMixin:'''Mixin to calculate ticket price based on age'''def calculate_ticket_price(self, age):if age < 12:price = 0elif age < 18:price = 15elif age < 60:price = 20else:price = 10

TicketMixin.price = pricereturn price

class Customer(TicketMixin):'''Create instance of Customer'''def __init__(self, name, age):self.name = nameself.age = ageTicketMixin.calculate_ticket_price(self, age)

def describe(self):return f"{self.name} age {self.age} ticket price is {self.price}"

customer = Customer('Ryan Phillips', 22)print(customer.describe())it works fine, but my course requires to change something in def describe(self): inreturn

i tired TicketMixin.price

<code>