Skip to content

Instantly share code, notes, and snippets.

@yunsu3042
Last active July 24, 2017 05:05
Show Gist options
  • Save yunsu3042/e6d079d7cff3b14bb612d980b771f9a8 to your computer and use it in GitHub Desktop.
Save yunsu3042/e6d079d7cff3b14bb612d980b771f9a8 to your computer and use it in GitHub Desktop.
value = [5,4,3,2,1]
1. bulit in functiond을 사용해 value의 값을 모두 없애시오.
2. a = value, value[1] = 10일 때 a[1]값과
a = value.copy() value[1] = 10일 때 a[1]의 값은 같을까?
3. c = [3, -4, 5, -6, 7] 일 때 sort메소드를 사용하여 제곱값이 큰 작은 순서대로 정렬하시오.
4. a = {1,2,3,4,5}, b = {2,3,4,5,6}라고 주어졌다.
4-1 a.difference(b)의 값 {1,6}이다. True or False
4-2 a - b 와 a.difference_update(b)의 값은 같다. True or False
4-3 a.discard(6) 오류가 난다. True or False
4-4 a와 b의 공통 요소만 뽑아 새로운 list를 만들어 보시오.
4-5 a.remove(6) 오류가 난다. True or False
4-6 a or b 연산을 하고 싶을 때 적절한 메소드는 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment