# Operasi komparasi
#setiap hasil dari operasi komparasi adalah boolean
a = 4
b = 2
#lebih besar dari (>)
hasil = a > b
print(a," > ",b, " = ",hasil)

#lebih kecil dari (<)
hasil = a < b
print(a," < ",b, " = ",hasil)

#lebih besar samadengan (>=)
hasil = a >=b
print(a," >= ",b, " = ",hasil)

#lebih kecil samadengan (<=)
hasil = a <=b
print(a," <= ",b, " = ",hasil)

# samadengan (==)
hasil = a == b
print(a," == ",b, " = ",hasil)

#tidak samadengan (!=)
hasil = a !=b
print(a," != ",b, " = ",hasil)

# 'is' sebaai komparasi object
x = 5
y = 5

print('nilai x =',x,'id = ',hex(id(x)))
print('nilai y =',y,'id = ',hex(id(y)))

hasil = x is y
print('x is y =',hasil)
7765afe8dbd8366895fa57510de57aafe2886f51
<mask token>

<mask token>
print(a, ' > ', b, ' = ', hasil)
<mask token>
print(a, ' < ', b, ' = ', hasil)
<mask token>
print(a, ' >= ', b, ' = ', hasil)
<mask token>
print(a, ' <= ', b, ' = ', hasil)
<mask token>
print(a, ' == ', b, ' = ', hasil)
<mask token>
print(a, ' != ', b, ' = ', hasil)
<mask token>
print('nilai x =', x, 'id = ', hex(id(x)))
print('nilai y =', y, 'id = ', hex(id(y)))
<mask token>
print('x is y =', hasil)

a = 4
b = 2
hasil = a > b
print(a, ' > ', b, ' = ', hasil)
hasil = a < b
print(a, ' < ', b, ' = ', hasil)
hasil = a >= b
print(a, ' >= ', b, ' = ', hasil)
hasil = a <= b
print(a, ' <= ', b, ' = ', hasil)
hasil = a == b
print(a, ' == ', b, ' = ', hasil)
hasil = a != b
print(a, ' != ', b, ' = ', hasil)
x = 5
y = 5
print('nilai x =', x, 'id = ', hex(id(x)))
print('nilai y =', y, 'id = ', hex(id(y)))
hasil = x is y
print('x is y =', hasil)

# Operasi komparasi
#setiap hasil dari operasi komparasi adalah boolean
a = 4
b = 2
#lebih besar dari (>)
hasil = a > b
print(a," > ",b, " = ",hasil)

#lebih kecil dari (<)
hasil = a < b
print(a," < ",b, " = ",hasil)

#lebih besar samadengan (>=)
hasil = a >=b
print(a," >= ",b, " = ",hasil)

#lebih kecil samadengan (<=)
hasil = a <=b
print(a," <= ",b, " = ",hasil)

# samadengan (==)
hasil = a == b
print(a," == ",b, " = ",hasil)

#tidak samadengan (!=)
hasil = a !=b
print(a," != ",b, " = ",hasil)

# 'is' sebaai komparasi object
x = 5
y = 5

print('nilai x =',x,'id = ',hex(id(x)))
print('nilai y =',y,'id = ',hex(id(y)))

hasil = x is y
print('x is y =',hasil)