python basic

자료형

  • list
    • list.append(d)
      • 자료 d 추가
    • list.insert(i, d)
      • index i에 자료 d 추가
    • list.remove(d)
      • 처음 나오는 자료 d 삭제
    • list.sort()
  • 시퀀스 자료형
    • 순서가 있는 자료형
    • indexing
    • slicing by using ’:’
    • searching member by using ‘in’
    • get length by using ‘len’
    • sum two of sequence data structure by using ’+’
  • dictionary
    • delete contents : del my_dictionary[key]
    • add contents : my_dictionary[key] = value
    • you don’t use list for key of dictionary data structure.

함수

a = input()   # assign user input message.
print(a)      # a
max(1,2,3)    # 3
min([1,2,3])  # 1
sum(1,2,3)    # 6
len("study")  # 5

Method

  • list
    mlist.sort()
    mlist.pop()
    mlist.count(10)
    mlist.clear()
    
  • dictionary
    mdict.keys()
    mdict.values()