Datasets:
Download basic_python_study/class_std_day1_1.py from ysn-rfd/text-dataset-tiny-code-script-py-format: direct link, hf CLI and curl.
- Browser
- Download file 418 Bytes
-
https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/basic_python_study/class_std_day1_1.py
- Command line
-
hf download hf://datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/basic_python_study/class_std_day1_1.py
-
curl -L -o class_std_day1_1.py https://huggingface.co/datasets/ysn-rfd/text-dataset-tiny-code-script-py-format/resolve/main/basic_python_study/class_std_day1_1.py
418 Bytes
| class Person: | |
| def __init__(self, name, age): | |
| self.name = name | |
| self.age = age | |
| user = Person("John", 36) | |
| print(user.name) | |
| print(user.age) | |
| #-------------------------------------- | |
| class Person2: | |
| def __init__(self, name, age): | |
| self.name = name | |
| self.age = age | |
| def __str__(self): | |
| return f"{self.name}({self.age})" | |
| user2 = Person2("John", 36) | |
| print(user2) | |