{"id":115376,"date":"2023-08-24T10:42:33","date_gmt":"2023-08-24T10:42:33","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=115376"},"modified":"2023-08-24T10:42:35","modified_gmt":"2023-08-24T10:42:35","slug":"wgu-c859-python-foundations-quiz-best-practice-questions-from-actual-past-exam","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2023\/08\/24\/wgu-c859-python-foundations-quiz-best-practice-questions-from-actual-past-exam\/","title":{"rendered":"WGU C859 Python Foundations Quiz (Best Practice Questions from Actual Past Exam)"},"content":{"rendered":"\n<p>https:\/\/forms.office.com\/Pages\/ResponsePage.aspx?id=z5Knz2h3QUOIV4F1TDNEpUTHQoQUJMHLrErGJyHg89uy71MyuHdVWklHQ05aRFMwOVlZ\u2026 1\/15<br>year= 2000<br>for i in range(2000,2018):<br>if i % 4 == 0:<br>year += 4<br>print (i)<br>Points: 16\/26<br>1<br>For years 2000 through 2018, create a list that contains only the leap years for<br>this time period. Print the completed list. (expected outcome: [2000, 2004, 2008,<br>2012, 2016]) *<br>(-\/1 Point)<br>2<br>Use the following list. Ensure that each name is only listed once and print the<br>set of unique names. (expected outcome: [&#8216;Cemal&#8217;, &#8216;Dana&#8217;, &#8216;David&#8217;, &#8216;Jerry&#8217;]) *<br>(-\/1 Point)<\/p>\n\n\n\n<p>https:\/\/forms.office.com\/Pages\/ResponsePage.aspx?id=z5Knz2h3QUOIV4F1TDNEpUTHQoQUJMHLrErGJyHg89uy71MyuHdVWklHQ05aRFMwOVlZ\u2026 2\/15<br>myNames = [&#8216;Dana&#8217;, &#8216;David&#8217;, &#8216;Cemal&#8217;, &#8216;Jerry&#8217;]<br>if &#8220;Letitia&#8221; not in myNames:<br>myNames.append(&#8220;Letitia&#8221;)<br>print (myNames)<br>3<br>Use the following list. Check to see if Letitia is in the list. If not, add her name<br>and print the updated list. (expected outcome: [&#8216;Cemal&#8217;, &#8216;Dana&#8217;, &#8216;Jerry&#8217;,&#8217;Letitia&#8217;]) *<br>(-\/1 Point)<br>4<br>Use the following dictionary. Print a message for each user in the dictionary that<br>matches the expected outcome below. (expected outcome for the first<br>employee (there should be four messages total): Whenever we go out, the<br>people always shout, John is the Senior VP!) *<br>(-\/1 Point)<br>myNames = [&#8216;Cemal&#8217;, &#8216;Dana&#8217;, &#8216;David&#8217;, &#8216;Cemal&#8217;, &#8216;Jerry&#8217;]<br>result = set(myNames)<br>myNames = list(result)<br>print (myNames)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/forms.office.com\/Pages\/ResponsePage.aspx?id=z5Knz2h3QUOIV4F1TDNEpUTHQoQUJMHLrErGJyHg89uy71MyuHdVWklHQ05aRFMwOVlZ\u2026 1\/15year= 2000for i in range(2000,2018):if i % 4 == 0:year += 4print (i)Points: 16\/261For years 2000 through 2018, create a list that contains only the leap years forthis time period. Print the completed list. (expected outcome: [2000, 2004, 2008,2012, 2016]) *(-\/1 Point)2Use the following list. Ensure that each name is only listed once and [&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":[25],"tags":[],"class_list":["post-115376","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/115376","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=115376"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/115376\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=115376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=115376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=115376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}