편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2022.10.11

    파이썬 딕셔너리 clear메소드


    fruits_dic={'apple':6000,'melon':3000,'banana':5000,'orange':7000}
    fruits_dic.clear()
    print(fruits_dic)
    

    결과값

    {}
    

    fruits_dic={'apple':6000,'melon':3000,'banana':5000,'orange':7000}
    
    print(fruits_dic.clear())
    

    결과값

    None
    

    두 개의 결과값이 다른 이유가 궁금합니다!

  • 프로필 jeongwonbahk님의 편집
    날짜2022.06.02

    파이썬 딕셔너리 clear메소드


    fruits_dic={'apple':6000,'melon':3000,'banana':5000,'orange':7000}
    fruits_dic.clear()
    print(fruits_dic)
    
    결과값
    {}
    -------------------------------------------------
    
    fruits_dic={'apple':6000,'melon':3000,'banana':5000,'orange':7000}
    
    print(fruits_dic.clear())
    
    결과값
    None
    

    두 개의 결과값이 다른 이유가 궁금합니다!