{"id":12,"date":"2025-09-19T14:05:36","date_gmt":"2025-09-19T14:05:36","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/e_henderson\/?p=12"},"modified":"2025-09-19T14:05:36","modified_gmt":"2025-09-19T14:05:36","slug":"free-friday-9-19-25","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/e_henderson\/2025\/09\/19\/free-friday-9-19-25\/","title":{"rendered":"Free-Friday 9\/19\/25"},"content":{"rendered":"\n<p class=\"has-ast-global-color-6-color has-text-color has-link-color wp-elements-2fa21abc5355520d80a7a66067f70df1\"><\/p>\n\n\n\n<p>Today in class, I made a countdown.<\/p>\n\n\n\n<p>I read a tut on how to do it.<\/p>\n\n\n\n<p>Link to tut:<a href=\"https:\/\/inventwithpython.com\/bigbookpython\/project14.html\">https:\/\/inventwithpython.com\/bigbookpython\/project14.html<\/a><\/p>\n\n\n\n<p>here&#8217;s my screenshot:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"859\" src=\"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-content\/uploads\/2025\/09\/image-1.png\" alt=\"\" class=\"wp-image-13\" srcset=\"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-content\/uploads\/2025\/09\/image-1.png 721w, https:\/\/theroyalscode.com\/students\/e_henderson\/wp-content\/uploads\/2025\/09\/image-1-252x300.png 252w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/figure>\n\n\n\n<p>import sys, time<\/p>\n\n\n\n<p>import sevseg<\/p>\n\n\n\n<p>secondsLeft = 30<\/p>\n\n\n\n<p>try:<\/p>\n\n\n\n<p>&nbsp; &nbsp; while True:<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; print(&#8216;\\n&#8217; * 60)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; hours = str(secondsLeft \/\/ 3600)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; minutes = str((secondsLeft % 3600) \/\/ 60)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; seconds = str(secondsLeft % 60)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; hDigits = sevseg.getSevSegStr(hours, 2)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; hTopRow, hMiddleRow, hBottomRow = hDigits.splitlines()<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; mDigits = sevseg.getSevSegStr(minutes, 2)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; mTopRow, mMiddleRow, mBottomRow = mDigits.splitlines()<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; sDigits = sevseg.getSevSegStr(seconds, 2)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; sTopRow, sMiddleRow, sBottomRow = sDigits.splitlines()<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; print(hTopRow &nbsp; &nbsp;+ &#8216; &nbsp; &nbsp; &#8216; + mTopRow &nbsp; &nbsp;+ &#8216; &nbsp; &nbsp; &#8216; + sTopRow)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; print(hMiddleRow + &#8216; &nbsp;* &nbsp;&#8216; + mMiddleRow + &#8216; &nbsp;* &nbsp;&#8216; + sMiddleRow)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; print(hBottomRow + &#8216; &nbsp;* &nbsp;&#8216; + mBottomRow + &#8216; &nbsp;* &nbsp;&#8216; + sBottomRow)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; if secondsLeft == 0:<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print()<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(&#8216; &nbsp; &nbsp;* * * * BOOM * * * *&#8217;)<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<\/p>\n\n\n\n<p>&nbsp; &nbsp; print()<\/p>\n\n\n\n<p>&nbsp; &nbsp; print(&#8216;Press Ctrl-C to quit.&#8217;)<\/p>\n\n\n\n<p>&nbsp; &nbsp; time.sleep(1)<\/p>\n\n\n\n<p>&nbsp; &nbsp; secondsLeft -= 1<\/p>\n\n\n\n<p>except KeyboardInterrupt:<\/p>\n\n\n\n<p>&nbsp; &nbsp; print(&#8216;Countdown, by Al Sweigart al@inventwithpython.com&#8217;)<\/p>\n\n\n\n<p>&nbsp; &nbsp; sys.exit()<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today in class, I made a countdown. I read a tut on how to do it. Link to tut:https:\/\/inventwithpython.com\/bigbookpython\/project14.html here&#8217;s [&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":"","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":"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":"","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-4)","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-4)","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-4)","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":[1],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/12\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}