HKCT KT night 20250507-0723
print("Hello, World!")
C:\Users\Your Name>python hello.py
Hello, World!
import sys
print(sys.version)
if 5>2:
print ("Five is greater than two!") #if 要縮排, 通常4格
print ("Thank you!") #要相同縮排
"""
THIS
IS
A
MULTI
LINES
COMMENTS
"""
print("Hello World!")
print(1+1) #先運算後出值
x=1
y=1
print(id(x)) # 1放在RAMM, X=1 係話比佢聽1在RAM的地址
print(id(y))
x=x+1 # 加優先過等號
y=1.0
print(x)
print(id(x),id(y))
print(type(x),type(y))
print(x>0)
""
This
is
a test
""
_y=1 #varible only can use_ or letter, double _ build in function
print(0.5-0.4) #0.1 會有誤差
print(0.5-0.2)
print(0.1+0.1+0.1) #0.3 會有誤差
INFO