/images/jg_02.jpg

07_Vue_Vuex Concept

​ Vuex 핵심컨셉(getters, mutations, actions, modules) 1. Getters 만약? A.vue와 B.vue에서 각각 store의 state에 등록된 second의 2를 3으로 변형해 사용하고 싶다면 어떻게 해야 할까? 저장소에 등록되어 있는 상태(state)를 변경하고 싶다면? 아마 귀찮겠지만, 각각의 파일에서 1 2 3 4 5 6 7 // A.vue computed: { change() { return this.$store.state.second + 1 } } 1 2 3 4 5 6 7 // B.vue computed: { change() { return this.

BEAKJOON 1149, 1932, 2579, 1463

​ 1149_RGB거리 1 2 3 4 5 6 7 8 9 10 11 12 13 N = int(input()) RGB = [list(map(int, input().split())) for _ in range(N)] for i in range(1, len(RGB)): RGB[i][0] = RGB[i][0] + min(RGB[i-1][1], RGB[i-1][2]) RGB[i][1] = RGB[i][1] + min(RGB[i-1][0], RGB[i-1][2]) RGB[i][2] = RGB[i][2] + min(RGB[i-1][0], RGB[i-1][1]) print(min(RGB[i][0], RGB[i][1], RGB[i][2])) # 2시간이 넘게 고민한 결과... # 문제 속 조건3 ""i(2 ≤ i ≤ N-1)번 집의 색은 i-1번, i+1번 집의 색과 같지 않아야 한다.

BEAKJOON 1103, 1904, 2748, 9461

​ 1003_피보나치 함수 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 def Fibonacci(N): if N < 3: print(zero[N], one[N]) else: f = 1 s = 2 for i in range(N-2): zero.append(zero[f] + zero[s]) one.append(one[f] + one[s]) f += 1 s += 1 print(zero[N], one[N]) for T in range(int(input())): N = int(input()) zero = [1, 0, 1] one = [0, 1, 1] Fibonacci(N) ​

Naming Convention

​ Naming Convention 정해진 규정은 없으나, 많은 개발자들이 암묵적으로 지키고 있는 이름짓는 방법. ​ snake_case 🐍 1 2 3 # _ == snake some_var = 5 my_awesome = 3 ​ camelCase 🐪 1 2 3 # 낙타등이 솟아 있는 모습 someVar = 5 pyAwesome = 3 ​ UpperCamelCase 🐪🐪 1 2 3 # 낙타얼굴과 등이 중간에 솟아 있는 모습 (파스칼식(Pascal case)이라고도 불린다.