Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
class Product: def __init__(self, name, price): self.__name = name self.__price = price @property def name(self): return self.__name @property def price(self): return self.__price from project.product import Product class Beverage(Product): def __init__(self, name, price, milliliters): super().__init__(self, name, price) self.__milliliters = milliliters from project.product import Product class Food(Product): def __init__(self, name, price, grams): super().__init__(self, name, price) self.__grams = grams import class HotBeverage(Beverage): def __init__(self, name, price, milliliters): super().__init__(self, name, price, milliliters) import class ColdBeverage(Beverage): def __init__(self, name, price, milliliters): super().__init__(self, name, price, milliliters) import class Coffee(HotBeverage): MILLILITERS = 50 PRICE = 3.50 def __init__(def __init__(self, name, caffeine): super().__init__(self, name, self.PRICE, self.MILLILITERS, caffeine): self.__caffeine = caffeine class Starter(Food): ........ class MainDish(Food): ........ class Dessert(Food): ........ class Salmon(MainDish): GRAMS = 22 ......
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)