{"id":2275,"date":"2025-04-28T09:01:02","date_gmt":"2025-04-28T00:01:02","guid":{"rendered":"https:\/\/blog.agentsoft.co.kr\/index.php\/2025\/04\/28\/2275\/"},"modified":"2025-04-28T09:01:02","modified_gmt":"2025-04-28T00:01:02","slug":"%ed%8c%8c%ec%9d%b4%ec%8d%ac%ec%9c%bc%eb%a1%9c-%eb%a7%a4%ec%b6%9c-%ea%b4%80%eb%a6%ac-%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%a8%ec%9d%84-%ea%b5%ac%ed%98%84%ed%95%9c-%ec%bd%94%eb%93%9c%ec%9e%85%eb%8b%88","status":"publish","type":"post","link":"https:\/\/blog.agentsoft.co.kr\/index.php\/2025\/04\/28\/2275\/","title":{"rendered":"\ud30c\uc774\uc36c\uc73c\ub85c \ub9e4\ucd9c \uad00\ub9ac \ud504\ub85c\uadf8\ub7a8\uc744 \uad6c\ud604\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4."},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image4.happycampus.com\/Production\/thumb212\/2024\/01\/06\/data29323993-0001.jpg\"><img decoding=\"async\" src=\"https:\/\/image4.happycampus.com\/Production\/thumb212\/2024\/01\/06\/data29323993-0002.jpg\"><\/p>\n<p><strong>\ubaa9\ucc28<\/strong><\/p>\n<p>\uc5c6\uc74c<\/p>\n<p><strong>\ubcf8\ubb38\ub0b4\uc6a9<\/strong><\/p>\n<p>\uc774 \ucf54\ub4dc\ub294 \uac04\ub2e8\ud55c \ub9e4\ucd9c \uad00\ub9ac \ud504\ub85c\uadf8\ub7a8\uc744 \uad6c\ud604\ud55c \ud30c\uc774\uc36c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ud504\ub85c\uadf8\ub7a8\uc740 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ub9e4\ucd9c\uc744 \uae30\ub85d\ud558\uac70\ub098 \ucd1d \ub9e4\ucd9c\uacfc \uc77c\uc77c \ud3c9\uade0 \ub9e4\ucd9c\uc744 \uacc4\uc0b0\ud558\ub294 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc774\uc81c \ucf54\ub4dc\uc758 \uac01 \ubd80\ubd84\uc744 \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud30c\uc77c \uacbd\ub85c \uc124\uc815:<\/p>\n<p>sales_data_file = &#8220;\ub9e4\ucd9c\uae30\ub85d.txt&#8221;<br \/>\nresult_file = &#8220;\uacb0\uc0b0.txt&#8221;<br \/>\nsales_data_file: \uc77c\uc77c \ub9e4\ucd9c\uc744 \uae30\ub85d\ud558\ub294 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc758 \uacbd\ub85c\uc785\ub2c8\ub2e4.<br \/>\nresult_file: \uacc4\uc0b0 \uacb0\uacfc\ub97c \uc800\uc7a5\ud558\ub294 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc758 \uacbd\ub85c\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc77c\uc77c \ub9e4\ucd9c \uae30\ub85d \ud568\uc218 (write_daily_sales):<\/p>\n<p>def write_daily_sales():<br \/>\n    try:<br \/>\n        daily_sales = float(input(&#8220;\uc77c\uc77c \ub9e4\ucd9c\uc744 \uc785\ub825\ud558\uc138\uc694: &#8220;))<br \/>\n        with open(sales_data_file, &#8220;a&#8221;) as file:<br \/>\n            file.write(f&#8221;{daily_sales:.2f}\\n&#8221;)<br \/>\n        print(&#8220;\ub9e4\ucd9c\uc774 \uae30\ub85d\ub418\uc5c8\uc2b5\ub2c8\ub2e4.&#8221;)<br \/>\n    except ValueError:<br \/>\n        print(&#8220;\uc62c\ubc14\ub978 \uc22b\uc790\ub97c \uc785\ub825\ud558\uc138\uc694.&#8221;)<\/p>\n<p>\uc0ac\uc6a9\uc790\uc5d0\uac8c \uc77c\uc77c \ub9e4\ucd9c\uc744 \uc785\ub825\ubc1b\uc544 sales_data_file\uc5d0 \uae30\ub85d\ud569\ub2c8\ub2e4.<br \/>\n\uc785\ub825\uac12\uc774 \uc22b\uc790\uac00 \uc544\ub2cc \uacbd\uc6b0 ValueError\ub97c \ucc98\ub9ac\ud558\uc5ec \uc608\uc678 \uba54\uc2dc\uc9c0\ub97c \ucd9c\ub825\ud569\ub2c8\ub2e4.<\/p>\n<p>\ucd1d \ub9e4\ucd9c \ubc0f \uc77c\uc77c \ud3c9\uade0 \ub9e4\ucd9c \uacc4\uc0b0 \ud568\uc218 (calculate_total_average_sales):<\/p>\n<p>def calculate_total_average_sales():<\/p>\n<p><\uc911 \ub7b5><\/p>\n<p>\uba54\uc778 \ud504\ub85c\uadf8\ub7a8:<\/p>\n<p>if __name__ == &#8220;__main__&#8221;:<br \/>\n    while True:<br \/>\n        # \uba54\ub274 \ucd9c\ub825<br \/>\n        print(&#8220;\\n\ub9e4\ucd9c \uad00\ub9ac \ud504\ub85c\uadf8\ub7a8&#8221;)<br \/>\n        print(&#8220;1. \uc77c\uc77c \ub9e4\ucd9c \uae30\ub85d&#8221;)<br \/>\n        print(&#8220;2. \ucd1d \ub9e4\ucd9c \ubc0f \uc77c\uc77c \ud3c9\uade0 \ub9e4\ucd9c \uacc4\uc0b0&#8221;)<br \/>\n        print(&#8220;3. \uc885\ub8cc&#8221;)<br \/>\n        choice = input(&#8220;\uc120\ud0dd: &#8220;)<\/p>\n<p>\ucd9c\ucc98 : <a href=\"https:\/\/www.happycampus.com\/report-doc\/29323993\/\" target=\"_blank\">\ud574\ud53c\ucea0\ud37c\uc2a4<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubaa9\ucc28 \uc5c6\uc74c \ubcf8\ubb38\ub0b4\uc6a9 \uc774 \ucf54\ub4dc\ub294 \uac04\ub2e8\ud55c \ub9e4\ucd9c \uad00\ub9ac \ud504\ub85c\uadf8\ub7a8\uc744 \uad6c\ud604\ud55c \ud30c\uc774\uc36c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ud504\ub85c\uadf8\ub7a8\uc740 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ub9e4\ucd9c\uc744 \uae30\ub85d\ud558\uac70\ub098 \ucd1d \ub9e4\ucd9c\uacfc \uc77c\uc77c \ud3c9\uade0 \ub9e4\ucd9c\uc744 \uacc4\uc0b0\ud558\ub294 \ub450 \uac00\uc9c0 \uc8fc\uc694 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc774\uc81c \ucf54\ub4dc\uc758 \uac01 \ubd80\ubd84\uc744 \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4. \ud30c\uc77c \uacbd\ub85c \uc124\uc815: sales_data_file = &#8220;\ub9e4\ucd9c\uae30\ub85d.txt&#8221; result_file = &#8220;\uacb0\uc0b0.txt&#8221; sales_data_file: \uc77c\uc77c \ub9e4\ucd9c\uc744 \uae30\ub85d\ud558\ub294 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc758 \uacbd\ub85c\uc785\ub2c8\ub2e4. result_file: \uacc4\uc0b0 \uacb0\uacfc\ub97c \uc800\uc7a5\ud558\ub294 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc758 \uacbd\ub85c\uc785\ub2c8\ub2e4. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4209,4210,2876,1653],"class_list":["post-2275","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-4209","tag-4210","tag-2876","tag-1653"],"_links":{"self":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts\/2275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/comments?post=2275"}],"version-history":[{"count":0,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts\/2275\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/media?parent=2275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/categories?post=2275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/tags?post=2275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}