forked from siddhi/python-functional
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_data.py
More file actions
44 lines (27 loc) · 670 Bytes
/
02_data.py
File metadata and controls
44 lines (27 loc) · 670 Bytes
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
33
34
35
36
37
38
39
40
41
students = ['Aparna', 'Anjali', 'Akshay']
teachers = ['Varsha', 'Vivek', 'Vinod']
def all_participants(students, teachers):
return students + teachers
everyone = all_participants(students, teachers)
print(everyone)
def get_student_fn(students, index):
def get():
return students[index]
return get
students = ['Aparna', 'Anjali', 'Akshay']
fn = get_student_fn(students, 1)
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
a = Point(2, 5)
b = Point(2, 5)
a.x = 10
from dataclasses import dataclass
@dataclass(frozen=True)
class Point:
x: int
y: int
a = Point(2, 5)
b = Point(2, 5)
print(a == b)