{"id":111315,"date":"2023-08-02T02:42:58","date_gmt":"2023-08-02T02:42:58","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=111315"},"modified":"2023-08-02T02:43:01","modified_gmt":"2023-08-02T02:43:01","slug":"wgu-c859-python-test-2023-2024","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2023\/08\/02\/wgu-c859-python-test-2023-2024\/","title":{"rendered":"WGU C859 Python Test 2023-2024"},"content":{"rendered":"\n<p>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;r&#8221;) &#8211; ANSWER &#8211; to open and read a file<br>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;w&#8221;) &#8211; ANSWER &#8211; to open and write a file (all previous<br>material discarded)<br>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;a&#8221;) &#8211; ANSWER &#8211; to open and add to a file<br>f1.read() &#8211; ANSWER &#8211; read a file into a string<br>f1.write(&#8220;hello!&#8221;) &#8211; ANSWER &#8211; writes to a file<br>f1.readline() &#8211; ANSWER &#8211; reads next line<br>f1.close() &#8211; ANSWER &#8211; closes a file (must always close a file!)<br>with open(&#8220;\/my_file\u2026etc) as f: &#8211; ANSWER &#8211; opens, allows work, and automatically<br>closes a file<br>timedelta &#8211; ANSWER &#8211; time library function to calculate time amounts<br>from datetime import timedelta &#8211; ANSWER &#8211; grabs timedelta from the datetime library<br>import datetime as dt &#8211; ANSWER &#8211; imports a library as a specified variable<br>datetime.date.today().month &#8211; ANSWER &#8211; to print current month (aka .day or .year for<br>those)<br>beautiful soup &#8211; ANSWER &#8211; HTML parsing library<br>NumPy &#8211; ANSWER &#8211; scientific computing, matrices, array creation library<br>pandas &#8211; ANSWER &#8211; data manipulation and analysis library<br>pillow (PIL) &#8211; ANSWER &#8211; work with and manipulate images; python imaging library<br>pyglet &#8211; ANSWER &#8211; multimedia \/ gaming creation library<br>pytz &#8211; ANSWER &#8211; time zone data library<\/p>\n","protected":false},"excerpt":{"rendered":"<p>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;r&#8221;) &#8211; ANSWER &#8211; to open and read a filef1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;w&#8221;) &#8211; ANSWER &#8211; to open and write a file (all previousmaterial discarded)f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;a&#8221;) &#8211; ANSWER &#8211; to open and add to a filef1.read() &#8211; ANSWER &#8211; read a file into a stringf1.write(&#8220;hello!&#8221;) &#8211; ANSWER &#8211; writes to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[],"tags":[],"class_list":["post-111315","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=111315"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111315\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=111315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=111315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=111315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}