개발/파이썬 7

python. isalnum과 isalpha

- isalnum : https://zetawiki.com/wiki/%ED%8C%8C%EC%9D%B4%EC%8D%AC_isalnum()- > 문자열이 알파벳([a-zA-Z])과 숫자([0-9])로만 구성되었는지 확인하는 파이썬 문자열 메소드 - isalpha : https://zetawiki.com/wiki/%ED%8C%8C%EC%9D%B4%EC%8D%AC_isalpha() > 문자열이 알파벳([a-zA-Z])으로만 구성되었는지 확인하는 파이썬 문자열 메소드 그 외) 파이썬 isdigit() 파이썬 islower() 파이썬 isupper()

개발/파이썬 2023.10.28

python. set 과 dict 차이

배경 알고리즘을 풀다보면, map과 같이 고유한 값만 가지도록 체크해야 하는 경우고 있는데, 그 경우 나는 항상 dict를 썼었다. 그러다가, 다음 유투브를 통해 set의 존재를 알게되었다. leetcode 풀이 > https://leetcode.com/problems/contains-duplicate/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com http..

개발/파이썬 2023.10.05

python. immutable과 mutable

immutable과 mutable - immutable 객체 > 생성된 이후 수정 불가능 > 이미 존재하는 객체이더라도 새로운 객체를 생성하여 재생성 - mutable 객체 : 수정 가능한 객체 > 생성된 이후 수정 가능 > 이미 존재하는 객체에 재할당 파이썬에서의 immutable, mutable 객체 Immutable 객체 int, float, str, tuple Mutable 객체 list, dict 참고 > - 레벨업 파이썬 immutable과 mutable https://wikidocs.net/91520 - Java의 Mutable과 Immutable https://velog.io/@guswlsapdlf/Java%EC%9D%98-Mutable%EA%B3%BC-Immutable

개발/파이썬 2023.08.29

python. 얕은복사와 깉은복사 (feat. 백준 15683)

얕은 복사(shallow copy)와 깊은 복사(deep copy) - 얕은 복사 : 원본 값과 복사된 값이 같은 참조(=메모리 주소)를 가리키는 것 > 객체 안에 객체가 있는 경우, 한 개의 객체라도 원본 객체를 참조하면 얕은 복사라고 볼 수 있음. - 깊은 복사 : 새로운 메모리 공간을 확보해 완전히 복사하는 것 파이썬에서의 얕은 복사(shallow copy)와 깉은 복사(deep copy) https://wikidocs.net/16038 12. 얕은 복사(shallow copy)와 깊은 복사(deep copy) ## 1. mutable과 immutable 객체 객체에는 mutable과 immutable 객체가 있습니다. ❈ 객체 구분 표 class 설명 구분 l… wikidocs.net dfs 알고..

개발/파이썬 2023.08.24

python. 띄어쓰기(개행문자) 없이 print 찍고 싶을때 (간단한 별찍기)

n = int(input()) for i in range(n): for j in range(i + 1): # 1부터 시작하게 : print("*", end = "") # 기본적으로 end에 개행문자 들어가있음: print("") 2438번: 별 찍기 - 1 첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제 www.acmicpc.net 참고블로그 | https://angelplayer.tistory.com/106 참고키워드 - 파이썬 별찍기 - 파이썬 띄어쓰기 없이 print - 백준 2438

개발/파이썬 2022.12.11
반응형