num1=10 ; num2=20
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

자동차의 전장과 전폭을 입력하면, 자동차 기계 세차 가능여부를 출력하는 코드 작성
최대 전장길이: 5200mm
최대 전폭길이: 1985mm
코드

결과값1

결과값 2

결과값3


cha1='A' # 아스키코드 65
cha2='S' # 아스키코드 83
print('\'{}\'>\'{}\' : {}'.format(cha1,cha2,(cha1>cha2)))
# 'A'>'S' : False
print('\'{}\'>=\'{}\' : {}'.format(cha1,cha2,(cha1>=cha2)))
# 'A'>='S' : False
print('\'{}\'<=\'{}\' : {}'.format(cha1,cha2,(cha1<cha2)))
# 'A'<='S' : True
print('\'{}\'<\'{}\' : {}'.format(cha1,cha2,(cha1<=cha2)))
# 'A'<'S' : True
print('\'{}\'==\'{}\' : {}'.format(cha1,cha2,(cha1==cha2)))
# 'A'=='S' : False
print('\'{}\'!=\'{}\' : {}'.format(cha1,cha2,(cha1!=cha2)))
# 'A'!='S' : True
print('\'A\'->{}' .format(ord('A')))
# 'A'->65
print('\'a\'->{}' .format(ord('a')))
# 'a'->97
print('\'s\'->{}' .format(ord('s')))
# 's'->115
print('65->\'{}\''.format(chr(65)))
# 65->'A'
print('97->\'{}\''.format(chr(97)))
# 97->'a'
print('115->\'{}\''.format(chr(115)))
# 115->'s'
str1= 'Hello'
str2= 'hello'
print('{}=={} : {}' .format(str1,str2,str1==str2))
# Hello==hello : False
print('{}!={} : {}' .format(str1,str2,str1!=str2))
# Hello!=hello : True





