配列/バイナリの宣言と呼び出し


1-1. 配列/バイナリ宣言形式


  • 整列
    array=[]

  • 専制的
    dictionary = {}

  • アレイの国:
    dictionary_in_array = [{key:value},{'key':value}]▶キー値は整数でも「文字列」でもOK!
  • 1-2. 配列/バイナリ呼び出し形式


  • シナリオ:
    array[index]

  • ディックシャナリー:
    dictionary[key]

  • アレイの国:
    dictionary_in_array[0] dictionary_in_array[0][key]▶値/キー値ともに(インデックスアクセス)または値(インデックス-キーアクセス)
  • 2.コード

    dictionary = {
        'pencil' : 3500,
        'pen' : 2500,
        'notebook' : 3000,
        5000 : 1500
    }
    
    #print(dictionary[0]) #출력불가
    #pint(dictionary{'pencil'}] #출력불가
    print(dictionary['pencil']) #정상출력
    print(dictionary[5000]) #정상출력
    
    array = [1, 2, 3]
    print(array[0]) #정상출력
    
    dictionary_in_array = [{'pencil': 3500}, {'pen' : 2500}]
    print(dictionary_in_array[0]) #정상출력
    print(dictionary_in_array[0]['pencil']) #정상출력
    

    3-1. リファレンスリンク


    https://blockdmask.tistory.com/429
    https://araikuma.tistory.com/357

    4. remind

    코드에 대한 이해가 우선이다. Not sugar syntax But sugar logic!