#리스트이름.pop()
list1 = ['딸기', '포도', '체리', '사과']
#list1.remove('포도')
list1.pop(1)
list1.pop() #마지막에 있는 원소 삭제
print(list1)
#리스트이름.count()
list2 = [2, 2, 2, 3, 3, 4, 5]
print(list2.count(3))
#문자열이름.split()
str1 = 'ialikeapython'
print(str1.split('a'))
str2 = '1 2 3 4 5'
print(str2.split(' '))
#리스트이름.join()
list3 = ['cola', 'cider']
print('&'.join(list3))
#튜플
() #빈 튜플
(1,) #하나여도 쉼표 필수
(1, 3, 5, 6)
tuple1 = ('a','b','c','d','e')
print(tuple1[1])
print(tuple1[1:3])
print(len(tuple1))
print('a' in tuple1)
#딕셔너리
#{key : value} 열쇠, 값
dict1 = {'apple':'사과', 'cat':'고양이'}
print(dict1['apple'])
dict1['dog'] = '개' #딕셔너리 추가
del dict1['apple'] #딕셔너리 삭제
print(dict1)
#딕셔너리의 key는 변할 수 없다
#dict2 = {(1, 2, 3):'a', [1, 2, 3]:'b'}
#key로 튜플은 사용할 수 있지만 리스트는 불가능하다
#내장함수
n = input() #입력받는 함수
print('') #출력하는 함수
max([1, 5, 6, 7]) #최댓값
min([0, 1, 2, 5]) #최솟값
len('abcdefg') #시퀀스의 길이
a = [10, 20, 30, 40, 50]
sum(a) #합계
To embed this project on your website, copy the following code and paste it into your website's HTML: