hello = []
hello.append(1)
hello.append(2)
hello.append(4)
hello.append(7)
print(hello)
#결과값 => [1,2,4,7]
비어있는 hello
라는 리스트를 만들고
1,2,4,7 이라는 숫자를 하나씩 append
(첨부)한다
days = ['월','화','수','목','금']
days2= ['토','일']
days+=days2
print(days)
#결과값 =>['월','화','수','목','금','토','일']
days = ['월','화','수','목','금']
print(days[3])
# 목 출력
print(days[-1])
# -1은 제일마지막요소를 출력한다
l = len(days)
print(days[l-1])
#len은 요소의 개수를알려준다
#전체요소개수 -1을하면 마지막요소가 출력된다