#함수
def flatten(data):
    output = []
    for i in data:
        print(i)
        if type(i) == list:
          output += flatten(i)
        else:
            output.append(i)
    return output
example = [[1,2,3],[4,5,6],7,[8,9]]
print("원본:",  example)
print("변환:",flatten(example))

원본: [[1, 2, 3], [4, 5, 6], 7, [8, 9]]
[1, 2, 3]
1
2
3
[4, 5, 6]
4
5
6
7
[8, 9]
8
9
변환: [1, 2, 3, 4, 5, 6, 7, 8, 9]

 

 

 

i = 2
ma = 10
to = 100
memo = {}

def table_sit(lef_p,sit_p):
    key = str([lef_p,sit_p])
    #조건 종료
    if key in memo:
        return memo[key]
    if lef_p < 0:
        return 0
    if lef_p == 0:
        return 1
    #재귀처리
    count = 0
    for i in range(sit_p,ma +1):
        count += table_sit(lef_p - i, i)
    # 메모화 처리
    memo[key] = count
     # 종료
    return count
print(table_sit(100,2))

437420

vi 파일명

:set fileformat=unix

보통 파일을 윈도우로 옮겼다가 다시 리눅스로 옮길경우 발생

[tht13.python]: 'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension.

 

보통 파드로 vscode를 만들었을 경우 볼륨 마운트가 /config 밑으로 된다

/home/HOSTPATH를  VSCODE POD의  /config로  마운트 했을 경우

minikube 서버에서 

 

[root@minikube tht13.python-0.2.2]# pwd
/home/HOSTPATH/extensions/tht13.python-0.2.2

 

vi  /home/HOSTPATH/extensions/tht13.python-0.2.2/package.json

 

일반 경로에서는

 

vi /home/yourlinuxusername/.vscode-server/extensions/tht13.python-0.2.3/package.json

 

 

+ Recent posts