forked from UCL-COMP0233-2023-2024/friend-group
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup.py
32 lines (22 loc) · 1.01 KB
/
group.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""An example of how to represent a group of acquaintances in Python."""
# Your code to go here...
my_group = 123
# class person:
# def __init__(self, name, age, job, **connection):
# self.name = name
# self.age = age # Note the default argument, occupants start empty
# self.job = job
# self.connection = connection
# Jill = person.__init__("Jill", 26, "biologist", "Zalika":"friend", "John":"partner")
# Zalika = person.__init__("Zalika", 28, "artist", "Jill" friend)
# John = person.__init__
# Nash = person.__init__
# - is 27, a writer, and Jill's partner.
# - is 34, a chef, John's cousin and Zalika's landlord.
- Jill is 26, a biologist and she is Zalika's friend and John's partner.
- Zalika is 28, an artist, and Jill's friend
- John is 27, a writer, and Jill's partner.
- Nash is 34, a chef, John's cousin and Zalika's landlord.
age = {"Jill":26, "Zalika":28, "John":27, "Nash":34}
job = {"Jill":"biologist", "Zalika":"artist", "John":"writer", "Nash":"chef"}
connection = {}