반응형
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
#test by Xd | |
list = ['a','s','d'] | |
if 's' in list: | |
print('s가 list에 있음') | |
print(list) | |
else: | |
print('s가 list에 없음') |

들여쓰기
1.가장 바깥쪽의 실행코드는 들여쓰기 없이 실행
예)
print('hello')
오류
print('hello')
hello
2.콜론(':') 다음 라인부터 시작하는 실행 코드는 들여쓰기 간격이 모두 동일
예)
list = ['e']
if 'e' in list:
print(list)
print('e가 list에 있음')
['e']
e가 list에 있음
공백의 길이가 같음(4칸)
반응형
'homework-jueon > 0x01-200제' 카테고리의 다른 글
10. if문 개념(if ~ elif) (0) | 2019.12.30 |
---|---|
9. if문 개념 (0) | 2019.12.30 |
7. print 줄바꿈 없애기 (0) | 2019.12.28 |
6. 자료형 print (0) | 2019.12.28 |
5. 자료형 개념 (0) | 2019.12.28 |