본문 바로가기
Algorithm

[Codeup] Python 기초 100제(2)

by Jiseong 2021. 5. 22.

 

6053부터

 

[6053]

n = bool(int(input()))
print(not n)

[6054]

n1, n2 = input().split()
print(bool(int(n1)) and bool(int(n2)))

[6055]

n1, n2 = input().split()
print(bool(int(n1)) != bool(int(n2)))

//XOR
print((bool(int(n1))and not(bool(int(n2)))) or (not(bool(int(n1)))and bool(int(n2))))

[6056]

n1, n2 = input().split()
print((bool(int(n1))) == (bool(int(n2))))

[6057]

n1, n2 = input().split()
print(not((bool(int(n1))) or (bool(int(n2)))))

[6058]

n = int(input())
print(~n)

[6059]

n1, n2 = input().split()
print(int(n1) & int(n2))

[6060]

n1, n2 = input().split()
print(int(n1) | int(n2))

[6061]

n1, n2 = input().split()
print(int(n1) ^ int(n2))

[6062]

n1, n2 = input().split()
print(int(n1) if(int(n1)>=int(n2)) else int(n2))

[6063]

n1, n2, n3 = input().split()
n1 = int(n1)
n2 = int(n2)
n3 = int(n3)
print((n1 if n1<n2 else n2) if ((n1 if n1<n2 else n2)<n3) else n3)

 

2021.05.22 - [Dev/Algorithm] - [Codeup] Python 기초 100제(1)

 

[Codeup] Python 기초 100제(1)

기초 100제 쭉 풀어보려한다. [6034] n1, n2 = input().split() n1 = int(n1) n2 = int(n2) if n1 > n2 : print(n1 - n2) else : print(n2 - n1) [6035] f1, f2 = input().split() m = float(f1) * float(f2) pri..

limjs-dev.tistory.com

 

댓글