반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 파이썬 가상환경 설치방법
- 네이버 로그인 하기
- venv 설치
- 네이버부동산크롤링
- uipath 입문
- 파이썬 가상환경 설치
- pywinauto 윈도우제어
- 파이썬 네이버 로그인
- vscode venv 설치
- 네이버커머스API
- Uipath 기초
- Selenium 셀렉터잡기
- 네이버 로그인 캡챠해결
- UiPath
- 네이버 로그인 영수증 해결
- pycdas.exe
- pywinauto 윈도우
- Element is not clickable at point
- Uipath 설치방법
- 날짜 정규식
- pycdc.exe
- 가상환경설치
- 왕초보 파이썬 실행
- 네이버매물크롤링
- pywinauto
- 파이썬 환경설정
- 파이썬네이버부동산
- Python
- selenium
- 커머스API
Archives
- Today
- Total
콘솔워크
Python의 포함 연산자 in, not in 본문
반응형
문자열, 배열, 튜플, 딕셔너리에 사용할 수 있다.
1. 문자열(strings)
########### in ###########
if 'p' in 'python':
print(True)
else:
print(False)
-------------------------
True
########### not in ###########
if 'k' not in 'python':
print(True)
else:
print(False)
-------------------------
True
2. 리스트(list)
############## in ##############
if 'a' in ['a','b','c']:
print(True)
else:
print(False)
--------------------------------
True
############## not in ##############
if 'd' not in ['a','b','c']:
print(True)
else:
print(False)
--------------------------------
True
3. 튜플(tuple)
############# in #############
if 'a' in ('a','b','c'):
print(True)
else:
print(False)
-------------------------
True
############# not in #############
if 'd' not in ('a','b','c'):
print(True)
else:
print(False)
-------------------------
True
4. 딕셔너리(Dictionary)
########### in ###########
if 'a' in {'a':1,'b':2}:
print(True)
else:
print(False)
---------------------------
True
########### not in ###########
if 'c' not in {'a':1,'b':2}:
print(True)
else:
print(False)
---------------------------
False
반응형
'프로그래밍 > python' 카테고리의 다른 글
기존의 list의 값을 이용해서 새로운 list를 만드는 방법 list comprehension (0) | 2023.07.06 |
---|---|
python decorator (0) | 2023.07.05 |
dict list를 key1을 기준으로 그룹화하고, 각 그룹에 속하는 key2들을 모으는 방법은 다음과 같습니다. (0) | 2023.06.26 |
selenium webdriver 새 탭 간의 이동 (0) | 2023.06.23 |
python pyinstaller exe file decomplie 과정 (0) | 2023.06.23 |