mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-27 23:11:57 +08:00
Retranslate the complete English edition from Simplified Chinese (#2010)
* Retranslate the complete English edition from Simplified Chinese * Polish three English explanations after reader-focused review
This commit is contained in:
@@ -10,28 +10,28 @@ from pathlib import Path
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
from modules import ListNode
|
||||
|
||||
"""Driver Code"""
|
||||
"""Driver code"""
|
||||
if __name__ == "__main__":
|
||||
num = 3
|
||||
hash_num = hash(num)
|
||||
print(f"Hash value of integer {num} is {hash_num}")
|
||||
print(f"Hash value of integer {num}: {hash_num}")
|
||||
|
||||
bol = True
|
||||
hash_bol = hash(bol)
|
||||
print(f"Hash value of boolean {bol} is {hash_bol}")
|
||||
print(f"Hash value of Boolean {bol}: {hash_bol}")
|
||||
|
||||
dec = 3.14159
|
||||
hash_dec = hash(dec)
|
||||
print(f"Hash value of decimal {dec} is {hash_dec}")
|
||||
print(f"Hash value of floating-point number {dec}: {hash_dec}")
|
||||
|
||||
str = "Hello algo"
|
||||
str = "Hello 算法"
|
||||
hash_str = hash(str)
|
||||
print(f"Hash value of string {str} is {hash_str}")
|
||||
print(f"Hash value of string {str}: {hash_str}")
|
||||
|
||||
tup = (12836, "Xiao Ha")
|
||||
tup = (12836, "小哈")
|
||||
hash_tup = hash(tup)
|
||||
print(f"Hash value of tuple {tup} is {hash(hash_tup)}")
|
||||
print(f"Hash of the hash value of tuple {tup}: {hash(hash_tup)}")
|
||||
|
||||
obj = ListNode(0)
|
||||
hash_obj = hash(obj)
|
||||
print(f"Hash value of node object {obj} is {hash_obj}")
|
||||
print(f"Hash value of node object {obj}: {hash_obj}")
|
||||
|
||||
Reference in New Issue
Block a user