Created
April 16, 2018 06:16
-
-
Save Kcrong/dfbd66f5cf0242539faf8ad4c826d627 to your computer and use it in GitHub Desktop.
세 수를 받고, 대소 관계를 >, ==, < 등의 기호로 보여주는 코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ai = input('num 1: ') | |
bi = input('num 2: ') | |
ci = input('num 3: ') | |
inp = sorted([ai, bi, ci]) | |
operators = ['>', '==', '<'] | |
def exp_c(a, b, op): | |
return eval("{} {} {}".format(a, op, b)) | |
for i in range(len(inp) - 1): | |
print(inp[i], end=' ') | |
for op_ in operators: | |
if exp_c(inp[i], inp[i + 1], op_): | |
print(op_, end=' ') | |
print(inp[-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment