tubeCoding
Python
Java demo
한국어(ko)
English(en)
한국어(ko)
로그인
회원가입
새 파일
CSV 파일 추가
파일 이름
취소
파일 생성
코드 실행
해당 파일은 텍스트 편집기에서 표시할 수 없습니다.
콘솔 출력
[{"type": "TextFile", "filename": "main.py", "content": "import requests\r\nimport xml.etree.ElementTree as ET #XML \ub77c\uc774\ube0c\ub7ec\ub9ac\r\nurl = \"https://www.w3schools.com/xml/simple.xml\" \r\nresponse = requests.get(url) #API \ud638\ucd9c\r\nroot = ET.fromstring(response.content) #XML \ud30c\uc2f1\r\nfirst_food = root.find(\"food\") #food \uc815\ubcf4 \ucd94\ucd9c\r\nname = first_food.find(\"name\").text\r\nprice = first_food.find(\"price\").text\r\nprint(f\"\uc74c\uc2dd\uba85: {name}\")\r\nprint(f\"\uac00\uaca9: {price}\")", "locked": true}]