Download pool/shard001/Python/0009141_inheritance.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 703 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard001/Python/0009141_inheritance.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard001/Python/0009141_inheritance.py
-
curl -L -o 0009141_inheritance.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard001/Python/0009141_inheritance.py
703 Bytes
| #! /usr/bin/env python | |
| # _*_coding:utf-8_*_ | |
| import self as self | |
| class Parent (): | |
| """ | |
| parent | |
| """ | |
| def __init__(self, last_name, eye_color): | |
| print("Parent Constructor Called") | |
| self.last_name = last_name | |
| self.eye_color = eye_color | |
| class Child(Parent): | |
| """ | |
| Child | |
| """ | |
| def __init__(self, last_name, eye_color, number_of_toys): | |
| print("Child Constructor Called") | |
| Parent.__init__(self, last_name, eye_color) | |
| self.number_of_toys = number_of_toys | |
| # billy_cyrus = Parent("Cyrus", "blue") | |
| # print(billy_cyrus.last_name) | |
| miley_cyrus = Child("Cyrus", "Blue", 5) | |
| print(miley_cyrus.last_name) | |
| print(miley_cyrus.number_of_toys) |