Guidelines

리슀트 λ‚΄ νŠΉμ • μš”μ†Œμ˜ 포함 μ—¬λΆ€λ₯Ό ν™•μΈν•˜λŠ” 방법

μ•žμ„œ 배운 in μ—°μ‚°μžλ₯Ό μ‚¬μš©ν•΄ 리슀트 λ‚΄ νŠΉμ • μš”μ†Œκ°€ μ‘΄μž¬ν•˜λŠ”μ§€ μ—¬λΆ€λ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

νŠΉμ • μš”μ†Œκ°€ μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ”μ§€ ν™•μΈν•˜λ €λ©΄ not in μ—°μ‚°μžλ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.


in μ—°μ‚°μž

in μ—°μ‚°μžλŠ” νŠΉμ • μš”μ†Œκ°€ λ¦¬μŠ€νŠΈμ— ν¬ν•¨λ˜μ–΄ μžˆλŠ”μ§€ κ²€μ‚¬ν•©λ‹ˆλ‹€.

in μ—°μ‚°μžλŠ” μš”μ†Œκ°€ λ¦¬μŠ€νŠΈμ— 있으면 True, μ—†μœΌλ©΄ Falseλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.

in μ—°μ‚°μž μ˜ˆμ‹œ
fruits = ["사과", "λ°”λ‚˜λ‚˜", "체리"] print("사과" in fruits) # True print("μ˜€λ Œμ§€" in fruits) # False

not in μ—°μ‚°μž

not in μ—°μ‚°μžλŠ” νŠΉμ • μš”μ†Œκ°€ λ¦¬μŠ€νŠΈμ— ν¬ν•¨λ˜μ–΄ μžˆμ§€ μ•Šμ€μ§€ κ²€μ‚¬ν•©λ‹ˆλ‹€.

μš”μ†Œκ°€ λ¦¬μŠ€νŠΈμ— μ—†μœΌλ©΄ True, 있으면 Falseλ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.

not in μ—°μ‚°μž μ˜ˆμ‹œ
fruits = ["사과", "λ°”λ‚˜λ‚˜", "체리"] print("μ˜€λ Œμ§€" not in fruits) # True print("사과" not in fruits) # False
Mission
0 / 1

리슀트 λ‚΄ νŠΉμ • μš”μ†Œμ˜ 포함 μ—¬λΆ€λ₯Ό ν™•μΈν•˜λŠ” 방법

리슀트 λ‚΄ νŠΉμ • μš”μ†Œμ˜ 쑴재 μ—¬λΆ€λ₯Ό ν™•μΈν•˜λŠ” in μ—°μ‚°μžλ₯Ό μ‚¬μš©ν•˜μ—¬ True λ˜λŠ” Falseλ₯Ό 좜λ ₯ν•΄ λ³΄μ„Έμš”.

fruits = ['사과', 'λ°”λ‚˜λ‚˜', '체리']


print('μ˜€λ Œμ§€' in 
)

Guidelines

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Execution Result