Home
Justnote
Cancel

[Python] 코드업 6096 : 바둑알 십자 뒤집기

Problem https://codeup.kr/problem.php?id=6096 Solving 우선 한 줄로 들어온 값을 리스트 안에 리스트의 형태로 어떻게 저장할 지 고민했었는데 첫번째는 go[i][1], ... , go[i][19] = map(int, input().split())과 같이 모든 변수를 써서 저장하는거였고 다른 하나는 go[1]...

TIL 220211

C printf 함수 특수문자 출력 특수문자를 출력하기 위해 백슬래시를 무조건 붙여야 하는줄 알고있었는데 알고보니 모든 특수문자가 아닌 아래와 같은 몇가지 특수문자에만 붙이면 되는거였다. 출력할 문자 명칭 작성법 ’ apostrophe ' ...

개인 프로젝트 계획

💡Projects Beginner Password Generator Tic-Tac-Toe Build a website with flask, django Web Scraper with beautiful soup, selenium Choose your own Text Adventure Game Intermediate 2D Ga...

TIL 220209

Python count 메서드 .count(self, x, __start, __end) 활용예시 num = [1,2,3,3] res = num.count(3) print(res) 실행결과 2 2차원 list 리스트 안에 리스트를 요소로 받는 형태 [[1,2],[3,4]] 비슷하게 리스트 안에 튜플, 튜플 안에 리스트를 넣을 수도 있음

[Python] 코드업 6095 : 바둑판에 흰 돌 놓기

Problem https://codeup.kr/problem.php?id=6095 Solution n = int(input()) white_coord = [] for i in range(n): white_coord.append(tuple(map(int,input().split()))) for i in range(1,20): for ...

[Python] 코드업 6092 : 이상한 출석 번호 부르기1

Problem https://codeup.kr/problem.php?id=6092 Solution n = int(input()) num = list(map(int,input().split())) for i in range(1, 24): print(num.count(i), end=' ') Memo count 메서드를 사용하지 않고 문제를 ...

[Python] 코드업 6091 : 함께 문제 푸는 날

Problem https://codeup.kr/problem.php?id=6091 Solution a, b, c = map(int,input().split()) lcm = max(a, b, c) while not(lcm % a == 0 and lcm % b == 0 and lcm % c == 0): lcm += 1 print(lcm) M...

[Python] 코드업 6082 : 3 6 9 게임의 왕이 되자

Problem https://codeup.kr/problem.php?id=6082 Solution n = int(input()) for i in range(1,n+1): if (i%10 == 3) or (i%10 == 6) or (i%10 == 9): print('X', end=' ') else: prin...

TIL 220208

Python 비트 연산자 AND 연산 a & b 비트 단위로 둘다 1이면 1, 아닐때 0 반환. OR 연산 a | b 비트 단위로 둘중 하나라도 1이면 1, 아니면 0 반환. XOR 연산 a ^ b 비트 단위로 두개가 다르면 1, 같다면 0 반환 삼항 연산자 print("True는 참" if True else "True는 거짓") 참일 때 값...

[Python] 코드업 6066 : 정수 3개 입력받아 짝/홀 출력하기

Problem https://codeup.kr/problem.php?id=6066 Solution arr = map(int,input().split()) for i in arr: print("even" if i % 2 == 0 else "odd") Memo 입력값을 리스트로 받아서 for문을 통해 하나씩 불러온 후 삼항연산자를 사용하여 ...