#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http 제목오늘자 퀴즈 2번째 문제 질문2019-11-07 15:09작성자읭첨부파일1.PNG (21.8KB)2.PNG (14KB)2번째꺼 에러 왜 났는지 모르겠어요ㅠㅠㅠ 누가 설명좀 해주세요ㅠQ1.def getDictionary(x): file=open(x,'r') Dict={} for line in file: a=line.split() Dict[a[0]]=int(a[1]) return(Dict) file.close()Q2.def getMaxScore(x): x=getDictionary(x) y=max(x) s=x['y'] s=int(s) return (y,s)# 아래는 테스트용 코드이며 삭제해도 무방함x = getDictionary("score.txt")print(x)(student,score) = getMaxScore(x)print(student,score)TypeError Traceback (most recent call last) <ipython-input-88-992a1f51f3e5> in <module> 3 x = getDictionary("score.txt") 4 print(x) ----> 5 (student,score) = getMaxScore(x) 6 print(student,score) <ipython-input-87-8bb7ac92a02a> in getMaxScore(x) 1 def getMaxScore(x): ----> 2 x=getDictionary(x) 3 y=max(x) 4 s=x['y'] 5 s=int(s) <ipython-input-74-07d9266f7af4> in getDictionary(x) 1 def getDictionary(x): ----> 2 file=open(x,'r') 3 Dict={} 4 for line in file: 5 a=line.split() TypeError: expected str, bytes or os.PathLike object, not dict 목록수정삭제답변글쓰기 댓글 [1] 댓글작성자(*)비밀번호(*)내용(*) 댓글 등록 더보기이전pygame 텀프로젝트에 책 예제의 함수를 써도 될까요?pygame2019-11-09다음퀴즈어렵당..베토벤2019-11-06 Powered by MangBoard | 워드프레스 쇼핑몰 망보드