Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI30_Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adrian Cansino
CSCI30_Project
Commits
f213035d
Commit
f213035d
authored
Nov 15, 2019
by
Temujin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FamilyTree and Person classes added.
parent
e41be62a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
family_tree.py
family_tree.py
+32
-0
No files found.
family_tree.py
View file @
f213035d
"""Family Tree project for CSCI 30."""
from
collections
import
defaultdict
class
FamilyTree
:
"""A family tree."""
def
__init__
(
self
,
root
):
self
.
family_tree
=
defaultdict
([
None
,
None
])
self
.
family_tree
[
root
]
=
[
None
,
None
]
pass
def
get_parent
(
self
,
name
):
class
Person
:
"""A person."""
def
__init__
(
self
,
name
,
age
,
sex
):
self
.
name
=
name
self
.
age
=
age
self
.
sex
=
sex
def
get_name
(
self
):
return
self
.
name
def
get_age
(
self
):
return
self
.
age
def
get_sex
(
self
):
return
self
.
sex
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment