Notice
Recent Posts
Recent Comments
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Archives
Today
Total
관리 메뉴

RUBY

비교 연산자 본문

프로그래밍 언어/Python

비교 연산자

ruby-jieun 2023. 1. 3. 17:04

 

 

비교 연산자

 

 

 

num1 = 10; num2 = 5

 

 

* 숫자 비교

result = num1 > num2
print('num1 > num2 : {}' .format(result))
num1 > num2 : True

 

 

result = num1 >= num2
print('num1 >= num2 : {}' .format(result))
num1 >= num2 : True

 

 

result = num1 < num2
print('num1 < num2 : {}' .format(result))
num1 < num2 : False

 

 

 

result = num1 <= num2
print('num1 <= num2 : {}' .format(result))
num1 <= num2 : False

 

 

 

result = num1 == num2
print('num1 == num2 : {}' .format(result))
num1 == num2 : False

 

 

 

 

result = num1 != num2
print('num1 != num2 : {}' .format(result))
num1 != num2 : True

'프로그래밍 언어 > Python' 카테고리의 다른 글

논리 연산자  (0) 2023.01.03
비교 연산자 2  (0) 2023.01.03
복합 연산자  (0) 2023.01.03
거듭제곱 연산자  (0) 2023.01.03
나머지 연산자  (0) 2022.12.30
Comments