Eugenia torceva distrattamente un foglio di carta tra le mani: lordine di eseguire un test del DNA per Giulia. Perché? A chi serviva? Forse i veri genitori di Giulia erano stati trovati? Allora perché non erano venuti, perché non avevano parlato? Le domande erano tante. Le risposte, nessuna.
“Mamma, che fai?” Giulia le toccò una spalla. “Ti ho chiamata e chiamata, ma non rispondevi.”
“Stavo pensando.”
“Chi ti ha scritto?”
“Niente di importante,” Eugenia infilò in fretta la lettera nella tasca del grembiule.
“Ho raccolto un secchio di more. Sono dolcissime. Ho anche riempito il serbatoio dellacqua. Stasera innaffierò lorto. Ti serve altro? Noi ragazze volevamo andare al fiume. Fa un caldo terribile.”
Persa nei suoi pensieri, rispose:
“Andate pure, ma state attente.”
Giulia afferrò un paio di focaccine calde, prese un asciugamano e corse via.
Eugenia aveva bisogno di mettere ordine nei suoi pensieri. Uscì in cortile e si sedette sul gradino della porta. “Che devo fare? Domani è il compleanno di Giulia. Che regalo le è toccato. Non per niente questa settimana non ho dormito.”
Sulla strada, unauto di lusso avanzava lentamente, fermandosi davanti al cancello. Ne scese una donna anziana ed elegante.
“Buongiorno, cerco Eugenia Nicolini.”
Il cuore le si strinse. Sentì che quella donna e la lettera erano collegate.
“Sono io.”
“Possiamo parlare? Mi chiamo Marina Gregori.”
“Ma certo, entri pure,” invitò Eugenia.
La donna fece un cenno allautista, che estrasse dal bagagliaio una grande borsa. Eugenia osservava tutto con paura.
“Alessandro, sei libero fino alle” la donna guardò il suo orologio costoso, “tre. Se avrò bisogno prima, ti chiamo.”
“Perché non va al fiume?” si aff# 1. `and`-`or` trick
“`
condition and true_value or false_value
“`
簡單判斷:
“`
>>> 1 and True or False
True
“`
“`
>>> 0 and True or False
False
“`
進階判斷:
“`
>>> 1 and ‘a’ or ‘b’
‘a’
>>> 0 and ‘a’ or ‘b’
‘b’
“`
判斷式等同於:
“`
‘true_value’ if condition else ‘false_value’
“`
# 2. `all` & `any`
`all(iterable)` : Return `True` if all elements of the iterable are true.
判斷可迭代物件內**所有**元素是否為`True`,若無元素則回傳`True`
“`
>>> all([])
True
>>> all([1, 2, 3, 0])
False
>>> all([1, 2, 3, True])
True
“`
`any(iterable)` : Return `True` if any element of the iterable is true.
判斷可迭代物件內**任一**元素是否為`True`,若無元素則回傳`False`
“`
>>> any([])
False
>>> any([1, 2, 3, 0])
True
>>> any([False, False, False])
False
“`
# 3. 一行簡單判斷
“`
>>> a = 3 if False else 4
>>> a
4
“`
“`
>>> a = 3 if True else 4
>>> a
3
“`
# 4. `for`-`else` 語法
`for` 迴圈完整執行後會執行`else`內的程式碼,若中途被`break`則不執行
“`
>>> for i in range(5):
… print(i)
… else:
… print(‘for loop finish’)
…
0
1
2
3
4
for loop finish
“`
“`
>>> for i in range(5):
… print(i)
… if i == 2:
… break
… else:
… print(‘for loop finish’)
…
0
1
2
“`
# 5. `dict` 代替多個 `if else`
“`
def fun(x):
if x == ‘a’:
return 1
elif x == ‘b’:
return 2
else:
return None
“`
等同於:
“`
def fun(x):
return {“a”: 1, “b”: 2}.get(x)
“`
# 6. 列表生成式
“`
>>> a = [i for i in range(10) if i % 2 == 0]
>>> a
[0, 2, 4, 6, 8]
“`
“`
>>> a = [i if i % 2 == 0 else ‘odd’ for i in range(10)]
>>> a
[0, ‘odd’, 2, ‘odd’, 4, ‘odd’, 6, ‘odd’, 8, ‘odd’]
“`
# 7. `lambda` 匿名函數
“`
>>> fun = lambda x: x + 1
>>> fun(1)
2
“`
“`
>>> fun = lambda x: x if x > 0 else “negative”
>>> fun(1)
1
>>> fun(-1)
‘negative’
“`
# 8. 三元運算
“`
>>> a = 1
>>> b = 2
>>> max = a if a > b else b
>>> max
2
“`
“`
>>> a = 1
>>> b = 2
>>> min = a if a < b else b
>>> min
1
“`
# 9. `with`-`as`
`with` 語句適用於對資源進行訪問的場合,確保不管使用過程中是否發生異常都會執行必要的清理操作,釋放資源
“`
with open(“test.txt”, “w”) as f:
f.write(“hello world”)
“`
等同於:
“`
f = open(“test.txt”, “w”)
try:
f.write(“hello world”)
finally:
f.close()
“`
# 10. 交換變數
“`
>>> a = 1
>>> b = 2
>>> a, b = b, a
>>> a
2
>>> b
1
“`
# 11. 序列解包
“`
>>> a, b, c = [1, 2, 3]
>>> a
1
>>> b
2
>>> c
3
“`
“`
>>> a, b, c = (1, 2, 3)
>>> a
1
>>> b
2
>>> c
3
“`
# 12. 判斷字串是否為數字
“`
>>> ‘123’.isdigit()
True
>>> ‘123.4’.isdigit()
False
“`
# 13. 反轉列表
“`
>>> a = [1, 2, 3, 4]
>>> a[::-1]
[4, 3, 2, 1]
“`
“`
>>> a = [1, 2, 3, 4]
>>> list(reversed(a))
[4, 3, 2, 1]
“`
# 14. 轉置二維陣列
“`
>>> original = [[‘a’, ‘b’], [‘c’, ‘d’], [‘e’, ‘f’]]
>>> transposed = zip(*original)
>>> list(transposed)
[(‘a’, ‘c’, ‘e’), (‘b’, ‘d’, ‘f’)]
“`
# 15. 鏈式比較
“`
>>> x = 3
>>> 1 < x < 5
True
>>> 4 < x < 5
False
```
# 16. 合併字典
```
>>> a = {‘a’: 1, ‘b’: 2}
>>> b = {‘b’: 3, ‘c’: 4}
>>> {**a, **b}
{‘a’: 1, ‘b’: 3, ‘c’: 4}
“`
# 17. 鏈式函數調用
“`
>>> def add(a, b):
… return a + b
…
>>> def subtract(a, b):
… return a – b
…
>>> a, b = 4, 5
>>> print((subtract if a > b else add)(a, b))
9
“`
# 18. 去重列表
“`
>>> a = [1, 2, 2, 3, 4, 4, 5]
>>> list(set(a))
[1, 2, 3, 4, 5]
“`
# 19. 字典 `get` 方法
“`
>>> d = {‘a’: 1, ‘b’: 2}
>>> d.get(‘c’, 3)
3
“`
# 20. 按鍵排序字典
“`
>>> d = {‘a’: 3, ‘b’: 2, ‘c’: 1}
>>> dict(sorted(d.items(), key=lambda x: x[1]))
{‘c’: 1, ‘b’: 2, ‘a’: 3}
“`
# 21. 按值排序字典
“`
>>> d = {‘a’: 3, ‘b’: 2, ‘c’: 1}
>>> dict(sorted(d.items(), key=lambda x: x[0]))
{‘a’: 3, ‘b’: 2, ‘c’: 1}
“`
# 22. 並行遍歷
“`
>>> a = [‘a’, ‘b’, ‘c’]
>>> b = [1, 2, 3]
>>> for i, j in zip(a, b):
… print(i, j)
…
a 1
b 2
c 3
“`
# 23. `enumerate` 索引
“`
>>> a = [‘a’, ‘b’, ‘c’]
>>> for i, j in enumerate(a):
… print(i, j)
…
0 a
1 b
2 c
“`
# 24. 合併列表為字典
“`
>>> a = [‘a’, ‘b’, ‘c’]
>>> b = [1, 2, 3]
>>> dict(zip(a, b))
{‘a’: 1, ‘b’: 2, ‘c’: 3}
“`
# 25. 合併相鄰字串
“`
>>> a = [‘a’, ‘b’, ‘c’, ‘d’]
>>> ”.join(a)
‘abcd’
“`
# 26. 統計元素出現次數
“`
>>> from collections import Counter
>>> a = [‘a’, ‘b’, ‘a’, ‘c’, ‘b’, ‘a’]
>>> Counter(a)
Counter({‘a’: 3, ‘b’: 2, ‘c’: 1})
“`
# 27. 展開嵌套列表
“`
>>> from itertools import chain
>>> a = [[1, 2], [3, 4], [5, 6]]
>>> list(chain(*a))
[1, 2, 3, 4, 5, 6]
“`
“`
>>> a = [[1, 2], [3, 4], [5, 6]]
>>> [j for i in a for j in i]
[1, 2, 3, 4, 5, 6]
“`
# 28. 隨機取樣
“`
>>> from random import sample
>>> a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> sample(a, 5)
[8, 2, 10, 5, 7]
“`
# 29. 分組列表
“`
>>> from itertools import groupby
>>> a = [{‘name’: ‘a’, ‘age’: 1}, {‘name’: ‘b’, ‘age’: 2}, {‘name’: ‘c’, ‘age’: 1}]
>>> groupby(a, key=lambda x: x[‘age’])
>>> for key, value in groupby(a, key=lambda x: x[‘age’]):
… print(key, list(value))
…
1 [{‘name’: ‘a’, ‘age’: 1}]
2 [{‘name’: ‘b’, ‘age’: 2}]
1 [{‘name’: ‘c’, ‘age’: 1}]
“`
# 30. 快速統計字串出現次數
“`
>>> from collections import defaultdict
>>> a = [‘a’, ‘b’, ‘a’, ‘c’, ‘b’, ‘a’]
>>> d = defaultdict(int)
>>> for i in a:
… d[i] += 1
…
>>> dict(d)
{‘a’: 3, ‘b’: 2, ‘c’: 1}
“`
# 31. 字典推導式
“`
>>> a = {‘a’: 1, ‘b’: 2, ‘c’: 3}
>>> {k: v*2 for k, v in a.items()}
{‘a’: 2, ‘b’: 4, ‘c’: 6}
“`
# 32. 集合推導式
“`
>>> a = [1, 2, 2, 3, 4, 4, 5]
>>> {i for i in a}
{1, 2, 3, 4, 5}
“`
# 33. 合併字典的 `update` 方法
“`
>>> a = {‘a’: 1, ‘b’: 2}
>>> b = {‘b’: 3, ‘c’: 4}
>>> a.update(b)
>>> a
{‘a’: 1, ‘b’: 3, ‘c’: 4}
“`
# 34. 快速反轉字串
“`
>>> a = ‘abc’
>>> a[::-1]
‘cba’
“`
# 35. 快速生成連續數字列表
“`
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
“`
# 36. 快速生成連續字母列表
“`
>>> import string
>>> list(string.ascii_lowercase[:5])
[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]
“`
# 37. 快速生成重複列表
“`
>>> [1] * 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
“`
# 38. 快速生成矩陣
“`
>>> [[0] * 3 for _ in range(3)]
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
“`
# 39. 快速打亂列表
“`
>>> from random import shuffle
>>> a = list(range(10))
>>> shuffle(a)
>>> a
[4, 8, 2, 1, 6, 7, 9, 3, 0, 5]
“`
# 40. 快速計算字元出現次數
“`
>>> from collections import Counter
>>> Counter(‘abracadabra’)
Counter({‘a’: 5, ‘b’: 2, ‘r’: 2, ‘c’: 1, ‘d’: 1})
“`
# 41. 快速計算列表元素出現次數
“`
>>> from collections import Counter
>>> Counter([‘a’, ‘b’, ‘a’, ‘c’, ‘b’, ‘a’])
Counter({‘a’: 3, ‘b’: 2, ‘c’: 1})
“`
# 42. 快速去除空白字元
“`
>>> ‘ hello ‘.strip()
‘hello’
“`
“`
>>> ‘ hello ‘.lstrip()
‘hello ‘
“`
“`
>>> ‘ hello ‘.rstrip()
‘ hello’
“`
# 43. 快速替換字串
“`
>>> ‘hello world’.replace(‘world’, ‘python’)
‘hello python’
“`
# 44. 快速分割字串
“`
>>> ‘a,b,c’.split(‘,’)
[‘a’, ‘b’, ‘c’]
“`
# 45. 快速連接字串
“`
>>> ‘,’.join([‘a’, ‘b’, ‘c’])
‘a,b,c’
“`
# 46. 快速判斷開頭或結尾
“`
>>> ‘hello world’.startswith(‘hello’)
True
>>> ‘hello world’.endswith(‘world’)
True
“`
# 47. 快速判斷是否為字母或數字
“`
>>> ‘a’.isalpha()
True
>>> ‘1’.isdigit()
True
“`
# 48. 快速判斷是否為空白字元
“`
>>> ‘ ‘.isspace()
True
“`
# 49. 快速判斷是否為標題
“`
>>> ‘Hello World’.istitle()
True
“`
# 50. 快速判斷是否為大寫或小寫
“`
>>> ‘HELLO’.isupper()
True
>>> ‘hello’.islower()
True
“`
# 51. 快速格式化字串
“`
>>> ‘{} {}’.format(‘hello’, ‘world’)
‘hello world’
“`
“`
>>> f”{‘hello’} {‘world’}”
‘hello world’
“`
# 52. 快速生成隨機數
“`
>>> from random import randint
>>> randint(1, 10)
4
“`
# 53. 快速生成隨機浮點數
“`
>>> from random import random
>>> random()
0.4288890546751146
“`
# 54. 快速生成隨機字串
“`
>>> import random
>>> import string
>>> ”.join(random.choices(string.ascii_letters + string.digits, k=10))
‘7qj9LJ9J9J’
“`
# 55. 快速生成隨機選擇
“`
>>> from random import choice
>>> choice([‘a’, ‘b’, ‘c’])
‘c’
>>> choice([‘a’, ‘b’, ‘c’])
‘a’
“`
# 56. 快速生成隨機樣本
“`
>>> from random import sample
>>> sample([‘a’, ‘b’, ‘c’, ‘d’, ‘e’], 3)
[‘b’, ‘a’, ‘d’]
“`
# 57. 快速生成隨機打亂
“`
>>> from random import shuffle
>>> a = [1, 2, 3, 4, 5]
>>> shuffle(a)
>>> a
[4, 2, 1, 5, 3]
“`
# 58. 快速生成 UUID
“`
>>> import uuid
>>> uuid.uuid4()
UUID(‘f47ac10b-58cc-4372-a567-0e02b2c3d479’)
“`
# 59. 簡單 HTTP 伺服器
“`
python -m http.server 8000
“`
# 60. 快速計算階乘
“`
>>> import math
>>> math.factorial(5)
120
“`
# 61. 快速計算排列組合
“`
>>> import math
>>> math.comb(5, 2)
10
>>> math.perm(5, 2)
20
“`
# 62. 簡單性能測試
“`
>>> import timeit
>>> timeit.timeit(‘”-“.join(str(n) for n in range(100))’, number=10000)
0.3412662749997253
“`
# 63. 快速計算平方根
“`
>>> import math
>>> math.sqrt(9)
3.0
“`
# 64. 快速計算對數
“`
>>> import math
>>> math.log(100, 10)
2.0
“`
# 65. 快速計算三角函數
“`
>>> import math
>>> math.sin(math.pi / 2)
1.0
“`
# 66. 快速計算最大公因數
“`
>>> import math
>>> math.gcd(12, 
4
“`
# 67. 快速計算最小公倍數
“`
>>> import math
>>> math.lcm(12, 
24
“`
# 68. 快速計算絕對值
“`
>>> abs(-1)
1
“`
# 69. 快速計算冪次
“`
>>> pow(2, 3)
8
“`
# 70. 快速計算商和餘數
“`
>>> divmod(5, 2)
(2, 1)
“`
# 71. 快速計算四捨五入
“`
>>> round(1.23456, 2)
1.23
“`
# 72. 快速計算進位
“`
>>> import math
>>> math.ceil(1.2)
2
“`
# 73. 快速計算退位
“`
>>> import math
>>> math.floor(1.8)
1
“`
# 74. 快速計算截斷
“`
>>> import math
>>> math.trunc(1.8)
1
“`
# 75. 快速計算布林值
“`
>>> bool(1)
True
>>> bool(0)
False
“`
# 76. 快速計算 ASCII 值
“`
>>> ord(‘a’)
97
>>> chr(97)
‘a’
“`
# 77. 快速計算 Unicode 值
“`
>>> ord(‘你’)
20320
>>> chr(20320)
‘你’
“`
# 78. 快速計算進制轉換
“`
>>> int(‘1010’, 2)
10
>>> bin(10)
‘0b1010’
“`
“`
>>> int(‘ff’, 16)
255
>>> hex(255)
‘0xff’
“`
“`
>>> int(’77’, 
63
>>> oct(63)
‘0o77’
“`
# 79. 快速計算位元運算
“`
>>> 1 & 0
0
>>> 1 | 0
1
>>> 1 ^ 0
1
>>> ~1
-2
>>> 1 << 2
4
>>> 4 >> 2
1
“`
# 80. 快速計算複數
“`
>>> 1 + 2j
(1+2j)
>>> (1 + 2j) * (3 + 4j)
(-5+10j)
“`
# 81. 快速計算分數
# 82. 快速計算十進制
“`
>>> from decimal import Decimal
>>> Decimal(‘0.1’) + Decimal(‘0.2’)
Decimal(‘0.3’)
“`
# 83. 快速計算簡單統計
“`
>>> import statistics
>>> statistics.mean([1, 2, 3, 4, 5])
3
“`
“`
>>> statistics.median([1, 2, 3, 4, 5])
3
“`
“`
>>> statistics.mode([1, 2, 2, 3, 4])
2
“`
“`
>>> statistics.stdev([1, 2, 3, 4, 5])
1.5811388300841898
“`
“`
>>> statistics.variance([1, 2, 3, 4, 5])
2.5
“`
# 84. 快速計算日期
“`
>>> from datetime import datetime
>>> datetime.now()
datetime.datetime(2021, 1, 1, 0, 0, 0, 0)
“`
# 85. 快速計算時間差
“`
>>> from datetime import datetime
>>> datetime.now() – datetime(2020, 1, 1)
datetime.timedelta(days=366)
“`
# 86. 快速計算時間戳
“`
>>> from datetime import datetime
>>> datetime.now().timestamp()
1609459200.0
“`
# 87. 快速計算時間格式化
“`
>>> from datetime import datetime
>>> datetime.now().strftime(‘%Y-%m-%d %H:%M:%S’)
‘2021-01-01 00:00:00’
“`
# 88. 快速計算時間解析
“`
>>> from datetime import datetime
>>> datetime.strptime(‘2021-01-01 00:00:00’, ‘%Y-%m-%d %H:%M:%S’)
datetime.datetime(2021, 1, 1, 0, 0)
“`
# 89. 快速計算時區
“`
>>> from datetime import datetime, timezone
>>> datetime.now(timezone.utc)
datetime.datetime(2021, 1, 1, 0, 0, 0, 0, tzinfo=datetime.timezone.utc)
“`
# 90. 快速計算定時任務
“`
>>> import time
>>> time.sleep(1)
“`
# 91. 快速計算執行時間
“`
>>> import time
>>> start = time.time()
>>> time.sleep(1)
>>> end = time.time()
>>> end – start
1.0000572204589844
“`
# 92. 快速計算進程 ID
“`
>>> import os
>>> os.getpid()
1234
“`
# 93. 快速計算環境變數
“`
>>> import os
>>> os.environ.get(‘PATH’)
‘/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin’
“`
# 94. 快速計算檔案資訊
“`
>>> import os
>>> os.path.getsize(‘test.txt’)
11
“`
“`
>>> os.path.getmtime(‘test.txt’)
1609459200.0
“`
“`
>>> os.path.getctime(‘test.txt’)
1609459200.0
“`
“`
>>> os.path.getatime(‘test.txt’)
1609459200.0
“`
# 95. 快速計算檔案是否存在
“`
>>> import os
>>> os.path.exists(‘test.txt’)
True
“`
# 96. 快速計算檔案是否為檔案或目錄
“`
>>> import os
>>> os.path.isfile(‘test.txt’)
True
>>> os.path.isdir(‘test.txt’)
False
“`
# 97. 快速計算檔案絕對路徑
“`
>>> import os
>>> os.path.abspath(‘test.txt’)
‘/Users/username/test.txt’
“`
# 98. 快速計算檔案相對路徑
“`
>>> import os
>>> os.path.relpath(‘test.txt’, ‘/Users’)
‘username/test.txt’
“`
# 99. 快速計算檔案目錄
“`
>>> import os
>>> os.path.dirname(‘/Users/username/test.txt’)
‘/Users/username’
“`
# 100. 快速計算檔案名稱
“`
>>> import os
>>> os.path.basename(‘/Users/username/test.txt’)
‘test.txt’
“`
# 101. 快速計算檔案副檔名
“`
>>> import os
>>> os.path.splitext(‘test.txt’)
(‘test’, ‘.txt’)
“`
# 102. 快速計算檔案路徑合併
“`
>>> import os
>>> os.path.join(‘/Users’, ‘username’, ‘test.txt’)
‘/Users/username/test.txt’
“`
# 103. 快速計算檔案路徑分割
“`
>>> import os
>>> os.path.split(‘/Users/username/test.txt’)
(‘/Users/username’, ‘test.txt’)
“`
# 104. 快速計算檔案路徑正規化
“`
>>> import os
>>> os.path.normpath(‘/Users/username/../test.txt’)
‘/Users/test.txt’
“`
# 105. 快速計算檔案路徑展開
“`
>>> import os
>>> os.path.expanduser(‘~/test.txt’)
‘/Users/username/test.txt’
“`
# 106. 快速計算檔案路徑展開變數
“`
>>> import os
>>> os.path.expandvars(‘$HOME/test.txt’)
‘/Users/username/test.txt’
“`
# 107. 快速計算檔案路徑真實路徑
# 108. 快速計算檔案路徑相對路徑
“`
>>> import os
>>> os.path.relpath(‘/Users/username/test.txt’, ‘/Users’)
‘username/test.txt’
“`
# 109. 快速計算檔案路徑共同前綴
“`
>>> import os
>>> os.path.commonprefix([‘/Users/username/test.txt’, ‘/Users/username/test2.txt’])
‘/Users/username/test’
“`
# 110. 快速計算檔案路徑共同路徑
“`
>>> import os
>>> os.path.commonpath([‘/Users/username/test.txt’, ‘/Users/username/test2.txt’])
‘/Users/username’
“`
# 111. 快速計算檔案路徑是否為絕對路徑
“`
>>> import os
>>> os.path.isabs(‘/Users/username/test.txt’)
True
“`
# 112. 快速計算檔案路徑是否為符號連結
“`
>>> import os
>>> os.path.islink(‘/Users/username/test.txt’)
False
“`
# 113. 快速計算檔案路徑是否為掛載點
“`
>>> import os
>>> os.path.ismount(‘/Users’)
False
“`
# 114. 快速計算檔案路徑是否為相同檔案
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 115. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 116. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 117. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 118. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 119. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 120. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 121. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 122. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 123. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 124. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 125. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 126. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test.txt’)
True
“`
# 127. 快速計算檔案路徑是否為相同檔案系統
“`
>>> import os
>>> os.path.samefile(‘/Users/username/test.txt’, ‘/Users/username/test. La donna aprì la borsa con gesti lenti, ne estrasse una piccola scatola di legno consumato dal tempo. “Questo apparteneva a vostra madre,” disse, la voce incrinata da unemozione trattenuta. “E ora, forse, appartiene a Giulia.” Eugenia fissò la scatola, poi lo sguardo le cadde sul foglio stropicciato ancora in tasca. Non era un addio, pensò. Era un inizio. E forse, dopo tanti anni, la verità non faceva più così paura.







