{"id":111311,"date":"2023-08-02T02:41:10","date_gmt":"2023-08-02T02:41:10","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=111311"},"modified":"2023-08-02T02:41:12","modified_gmt":"2023-08-02T02:41:12","slug":"wgu-c859-python-test-2023","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2023\/08\/02\/wgu-c859-python-test-2023\/","title":{"rendered":"WGU C859 Python Test 2023"},"content":{"rendered":"\n<p>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;r&#8221;) Ans- to open and read a file<br>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;w&#8221;) Ans- to open and write a file (all previous<br>material discarded)<br>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;a&#8221;) Ans- to open and add to a file<br>f1.read() Ans- read a file into a string<br>f1.write(&#8220;hello!&#8221;) Ans- writes to a file<br>f1.readline() Ans- reads next line<br>f1.close() Ans- closes a file (must always close a file!)<br>with open(&#8220;\/my_file\u2026etc) as f: Ans- opens, allows work, and automatically closes a file<br>timedelta Ans- time library function to calculate time amounts<br>from datetime import timedelta Ans- grabs timedelta from the datetime library<br>import datetime as dt Ans- imports a library as a specified variable<br>datetime.date.today().month Ans- to print current month (aka .day or .year for those)<br>beautiful soup Ans- HTML parsing library<br>NumPy Ans- scientific computing, matrices, array creation library<br>pandas Ans- data manipulation and analysis library<br>pillow (PIL) Ans- work with and manipulate images; python imaging library<br>pyglet Ans- multimedia \/ gaming creation library<br>pytz Ans- time zone data library<br>pip install <strong><em><strong><em>_<\/em><\/strong><\/em><\/strong><em> import <strong><em><strong>____<\/strong><\/em><\/strong><\/em> Ans- to install and import a library<br>into your code<\/p>\n","protected":false},"excerpt":{"rendered":"<p>f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;r&#8221;) Ans- to open and read a filef1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;w&#8221;) Ans- to open and write a file (all previousmaterial discarded)f1 = open(&#8220;\/my_path\/my_file.text&#8221;, &#8220;a&#8221;) Ans- to open and add to a filef1.read() Ans- read a file into a stringf1.write(&#8220;hello!&#8221;) Ans- writes to a filef1.readline() Ans- reads next linef1.close() Ans- closes a file [&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-111311","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111311","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=111311"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/111311\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=111311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=111311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=111311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}