Not null
  • 홈
  • IT정보
  • C
  • Assemble
  • Python
  • System programing
  • Window
  • Linux
  • System
  • Web
  • Network
  • Forensic
  • 메뉴 닫기
  • 글작성
  • 방명록
  • 환경설정
    • All (102)
      • network (14)
      • ARM (2)
      • Programing (41)
        • C (3)
        • Assemble (0)
        • Python (8)
        • JavaScript (1)
        • Systemprograming (0)
        • 자료구조, Algorithm (20)
        • Web (4)
        • Git (2)
        • DataBase (1)
        • 운영, 배포, 관리 (2)
      • OS (4)
        • Window (0)
        • Linux (1)
        • theory (3)
      • etc, (3)
      • Hacking (18)
        • System technique (3)
        • Web technique (6)
        • Reversing (9)
      • wargame (11)
      • project (5)
        • android (2)
        • Automated vulnerability (0)
        • Vulnerability analysis (1)
        • Malware Analysis (0)
        • Code Virtualized (1)
      • school.study (1)
  • 홈
  • 태그
  • 방명록
Programing/Python

python 내장함수 all, any에 대해 알아보자

any와 all의 내장 함수 동작 any: 요소중에 하나라도 True라면 True, 모두 False라면 False all: 요소중에 모두가 True여야 True, 하나라도 False라면 False any와 all이 어떻게 쓰일까? Any 리스트 내부의 요소들에 접근하여 크기 비교를 하는 경우 numbers = [1, 2, 3, 4] # 3보다 큰 수가 있다면 '존재' 출력 if any(number > 3 for number in numbers): print('존재') else: print('존재하지 않음') # for 문으로 나타 내었을 때 flag = False for number in numbers: if number > 3: flag = True break..

2022. 5. 27. 20:35
Programing/Python

Python 메모리 관리 (Garbage Collection)

https://blog.winterjung.dev/2018/02/18/python-gc

2022. 4. 22. 03:44
Programing/자료구조, Algorithm

바이너리 서치 python (binary search python)

바이너리 서치란? 정렬 된 자료를 반으로 나누어 계속하여 탐색하는 방법 정렬 할 자료는 오름차순 이어야 함 퍼포먼스가 좋음 구현시 필요한 변수 target : 찾고자 하는 목표 값 data : 오름차순으로 정렬 된 list (찾을 위치) start : data의 처음 값 index end : data의 마지막 값 index mid : start - end 의 중간 값 구현 (재귀) def bin_search(data, target, start, end): idx = (start + end) // 2 mid = data[idx] if target == mid: print(f'idx: {idx}') return elif mid > target: bin_search(data, target, start, idx..

2022. 4. 15. 03:27
Programing/자료구조, Algorithm

programmers 추석트래픽 [python]

def solution(lines): answer = 0 trafics = [] for l in lines: elements = l.split() S = elements[1].split(':') s = int((int(S[0]) * 3600 * 1000) + (int(S[1]) * 60 * 1000) + (float(S[2]) * 1000)) t = int(float(elements[2][:-1]) * 1000) start = (s - t) + 1 end = s trafics.append((start, end)) for trafic in trafics: count = 0 for tr in trafics: if tr[1] >= trafic[1] and tr[0] < trafic[1] + 1000: coun..

2022. 3. 15. 00:52
Programing/자료구조, Algorithm

programmers -프렌즈4블록- (python)

def solution(m, n, board): answer = 0 maps = [] # maps 좌표 만들기 for i in range(0, m): tmp = [] for j in range(0, n): tmp.append(board[i][j]) maps.append(tmp) while True: rm = [] # 지워질 블록 수집 for x in range(0, m-1): for y in range(0, n-1): if maps[x][y] == maps[x+1][y] and maps[x][y+1] == maps[x+1][y+1] and maps[x][y] == maps[x+1][y+1] and maps[x][y] != 0: rm.append((x, y)) rm.append((x+1, y)) rm.ap..

2022. 3. 14. 03:50
Programing/자료구조, Algorithm

프로그래머스(programmers) 신고 결과 받기 -python-

from collections import defaultdict def solution(id_list, report, k): report = set(report) answer = [] mails = defaultdict(int) # 메일 받을 개수 딕셔너리 users = defaultdict(int) # 유저 초기화 for u in id_list: mails[u] users[u] reports = defaultdict(list) # 신고 한 사람 저장 for r in report: a, b = r.split() reports[b].append(a) for i in users: # 신고 당한 횟수 지정 users[i] = len(reports[i]) pass for user in users: # "신고가 ..

2022. 3. 10. 20:24
  • «
  • 1
  • 2
  • 3
  • 4
  • ···
  • 17
  • »

공지사항

전체 카테고리

  • All (102)
    • network (14)
    • ARM (2)
    • Programing (41)
      • C (3)
      • Assemble (0)
      • Python (8)
      • JavaScript (1)
      • Systemprograming (0)
      • 자료구조, Algorithm (20)
      • Web (4)
      • Git (2)
      • DataBase (1)
      • 운영, 배포, 관리 (2)
    • OS (4)
      • Window (0)
      • Linux (1)
      • theory (3)
    • etc, (3)
    • Hacking (18)
      • System technique (3)
      • Web technique (6)
      • Reversing (9)
    • wargame (11)
    • project (5)
      • android (2)
      • Automated vulnerability (0)
      • Vulnerability analysis (1)
      • Malware Analysis (0)
      • Code Virtualized (1)
    • school.study (1)
애드센스 광고 영역

블로그 인기글

Powered by Privatenote Copyright © Not null All rights reserved. TistoryWhaleSkin3.4

티스토리툴바