-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheq_list_dict.act
122 lines (94 loc) · 2.18 KB
/
eq_list_dict.act
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
actor main(env):
a = [1,2,3]
if a == [1,2,3]:
print("Equal, correct")
else:
print("Not equal, wrong")
if a == [1,2]:
print("Equal, wrong")
else:
print("Not equal, correct")
if a == [1,5,2]:
print("Equal, wrong")
else:
print("Not equal, correct")
if [3.5,7.2] == [3.5, 7.2]:
print("Equal, correct")
else:
print("Not equal, wrong")
if [a,a] == [[1,2,3],[1,2,3]]:
print("Equal, correct")
else:
print("Not equal, wrong")
if [a,a] == [[1,2,3],[1,3]]:
print("Equal, wrong")
else:
print("Not equal, correct")
if ["hello", "world"]==["Hello","word"]:
print("Equal, wrong")
else:
print("Not equal, correct")
d1, d2 : dict[str,str]
d1 = {}
d1["Sweden"] = "Stockholm"
d1["Norway"] ="Oslo"
d1["Denmark"] = "Copenhagen"
d2 = {}
d2["Norway"] ="Oslo"
d2["Denmark"] = "Copenhagen"
d2["Sweden"] = "Stockholm"
if d1==d2:
print("Equal, correct")
else:
print("Not equal, wrong")
d2["Finland"] = "Helsinki"
if d1==d2:
print("Equal, wrong")
else:
print("Not equal, correct")
d3, d4 : dict[bool,dict[str,str]]
d3 = {}
d3[True] = d1
d3[False] = d2
d4 = {}
d4[False] = d2
d4[True] = d1
if d3==d4:
print("Equal, correct")
else:
print("Not equal, wrong")
d2["Estonia"] = "Tallinn"
if d3==d4:
print("Equal, correct")
else:
print("Not equal, wrong")
print("now to Ord")
if ([3,4,5] < [3,4,5,8]):
print("lt, correct")
else:
print("Not lt, wrong")
if ([3,4,5] < [3,4,6,8]):
print("lt, correct")
else:
print("Not lt, wrong")
if ([3,4,5,6,7] < [3,4,6,1,2,3,4]):
print("lt, correct")
else:
print("Not lt, wrong")
if ([3,4,5,6,7] <= [3,4,6,1,2,3,4]):
print("le, correct")
else:
print("Not le, wrong")
if ([3,4,6,1,2,3,4] > [3,4,5,6,7]):
print("gt, correct")
else:
print("Not gt, wrong")
if d1 < d2:
print("lt, correct")
else:
print("Not lt, wrong")
if d3 <= d4:
print("le, correct")
else:
print("Not le, wrong")
env.exit(0)