Comparison
การเปรียบเทียบค่าในภาษา python แบ่งเป็น 4 แบบ ดังนี้
logical : and, or, not, and not เช่น
(len(list) >= 0) and (boo != False)identity : is, is not, not เช่น
not (boo)arithmetic : >, >=, <, <=, ==, != เช่น
len(list) >= 0,boo != FalseNull : None เช่น
list != Noneซึ่งเรื่องนี้นำไปใช้ใน condition statement
Last updated