[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-692233-105":59,"doc-detail-692233-en":130,"doc-similar-692233":239},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","hands-on-python-tutorial-release-20","Hands-on Python Tutorial - Release 2.0","","Hands-on Python Tutorial (Release 2.0) introduces Python programming through a structured progression from core concepts to practical application. It begins with context for how computers execute instructions, contrasts low-level and high-level operations, and explains why Python is approachable yet powerful. Early sections cover obtaining Python, the interpreter and editor workflow, and foundational syntax for types, functions, arithmetic, strings, variables, and input/output. The tutorial continues into functions, dictionaries, control flow, and building dynamic web pages using Python.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/hands-on-python-tutorial-release-20/692233/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/hands-on-python-tutorial-release-20/692233.png","ImageObject",300,407,{"name":92,"@type":93},"MrHarris58","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-17","2026-11-09",true,{"@type":102,"interactionType":103,"userInteractionCount":39},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the purpose of the tutorial’s early chapters?","Question",{"text":112,"@type":113},"They establish how computers and high-level languages relate, explain why Python is a good choice, and guide learners through installing/using Python and the basic workflow with the interpreter and editor.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does the tutorial connect computer hardware concepts to learning Python?",{"text":117,"@type":113},"It contrasts low-level hardware instructions with higher-level language instructions, then explains how high-level code is translated into machine language before execution.",{"name":119,"@type":110,"acceptedAnswer":120},"Which Python skills are introduced before moving to more advanced topics and web development?",{"text":121,"@type":113},"The tutorial covers core syntax and data handling such as types and functions, integer and floating-point arithmetic, strings, variables and assignment, printing, input/output, and foundational control structures like loops and sequences.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},692233,1794186384,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":39,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":145,"preview_urls":146},687212988360,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Hands-on Python Tutorial  \nRelease 2.0  \nDr. Andrew N. Harrington  \nMay 25, 2020  \nCONTENTS  \n1 Beginning With Python 3  \n1.1 Context .................................................. 3  \n1.2 The Python Interpreter and Idle, Part I .................................. 7  \n1.3 Whirlwind Introduction To Types and Functions ............................ 13  \n1.4 Integer Arithmetic ............................................ 14  \n1.5 Strings, Part I ............................................... 17  \n1.6 Variables and Assignment ........................................ 18  \n1.7 Print Function, Part I ........................................... 21  \n1.8 Strings Part II ............................................... 21  \n1.9 The Idle Editor and Execution ...................................... 22  \n1.10 Input and Output ............................................. 25  \n1.11 Deﬁning Functions of your Own ..................................... 30  \n1.12 Dictionaries ................................................ 42  \n1.13 Loops and Sequences .......................................... 47  \n1.14 Decimals, Floats, and Floating Point Arithmetic ............................ 61  \n1.15 Summary ................................................. 64  \n2 Objects and Methods 73  \n2.1 Strings, Part III .............................................. 73  \n2.2 More Classes and Methods ........................................ 80  \n2.3 Mad Libs Revisited ............................................ 82  \n2.4 Graphics ................................................. 88  \n2.5 Files ................................................... 114  \n2.6 Summary ................................................. 117  \n3 More On Flow of Control 121  \n3.1 If Statements ............................................... 121  \n3.2 Loops and Tuples ............................................. 138  \n3.3 While Statements ............................................. 143  \n3.4 Arbitrary Types Treated As Boolean ................................... 158  \n3.5 Further Topics to Consider ........................................ 160  \n3.6 Summary ................................................. 161  \n4 Dynamic Web Pages 165  \n4.1 Overview ................................................. 165  \n4.2 Web page Basics ............................................. 166  \n4.3 Composing Web Pages in Python .................................... 168  \n4.4 CGI-Dynamic Web Pages ........................................ 172  \n4.5 Summary ................................................. 183  \n5 Appendices 187  \n5.1 Using Error Messages .......................................... 187  \n5.2 Some Special Windows Instructions ................................... 193  \n5.3 Some Special Mac Instructions ..................................... 194  \n5.4 HTML Source Markup .......................................... 197  \nDr. Andrew N. Harrington  \nComputer Science Department, Loyola University Chicago  \n© Released under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 United States License [https://creativecommons.org/licenses/by-nc-sa/4.0/](https://creativecommons.org/licenses/by-nc-sa/4.0/)—————  \nCHAPTER  \nONE  \nBEGINNING WITH PYTHON  \n© Released under the Creative commons Attribution-Noncommercial-Share Alike 3.0 United States License [http://creativecommons.org/licenses/by-nc-sa/3.0/us/](http://creativecommons.org/licenses/by-nc-sa/3.0/us/)  \n1.1 Context  \nYou have probably used computers to do all sorts of useful and interesting things. In each application, the computer responds in different ways to your input, from the keyboard, mouse or a ﬁle. Still the underlying operations are determined by the design of the program you are given. In this set of tutorials you will learn to write your own computer programs, so you can give the computer instructions to react in the way you want.  \n1.1.1 Low-Level and High-Level Computer Operations  \nFirst let us place Python programming in the context ","cbCaifKmfnhtfNS0","https://ap.wps.com/l/cbCaifKmfnhtfNS0","pdf",1104986,207,"English","# 1 Beginning With Python 3\n## 1.1 Context\n## 1.2 The Python Interpreter and Idle, Part I\n## 1.3 Whirlwind Introduction To Types and Functions\n## 1.4 Integer Arithmetic\n## 1.5 Strings, Part I\n## 1.6 Variables and Assignment\n## 1.7 Print Function, Part I\n## 1.8 Strings Part II\n## 1.9 The Idle Editor and Execution\n## 1.10 Input and Output\n## 1.11 Defining Functions of your Own\n## 1.12 Dictionaries\n## 1.13 Loops and Sequences\n## 1.14 Decimals, Floats, and Floating Point Arithmetic\n## 1.15 Summary\n# 2 Objects and Methods\n## 2.1 Strings, Part III\n## 2.2 More Classes and Methods\n## 2.3 Mad Libs Revisited\n## 2.4 Graphics\n## 2.5 Files\n## 2.6 Summary\n# 3 More On Flow of Control\n## 3.1 If Statements\n## 3.2 Loops and Tuples\n## 3.3 While Statements\n## 3.4 Arbitrary Types Treated As Boolean\n## 3.5 Further Topics to Consider\n## 3.6 Summary\n# 4 Dynamic Web Pages\n## 4.1 Overview\n## 4.2 Web page Basics\n## 4.3 Composing Web Pages in Python\n## 4.4 CGI-Dynamic Web Pages\n## 4.5 Summary\n# 5 Appendices\n## 5.1 Using Error Messages\n## 5.2 Some Special Windows Instructions\n## 5.3 Some Special Mac Instructions\n## 5.4 HTML Source Markup","[{\"question\":\"What is the purpose of the tutorial’s early chapters?\",\"answer\":\"They establish how computers and high-level languages relate, explain why Python is a good choice, and guide learners through installing/using Python and the basic workflow with the interpreter and editor.\"},{\"question\":\"How does the tutorial connect computer hardware concepts to learning Python?\",\"answer\":\"It contrasts low-level hardware instructions with higher-level language instructions, then explains how high-level code is translated into machine language before execution.\"},{\"question\":\"Which Python skills are introduced before moving to more advanced topics and web development?\",\"answer\":\"The tutorial covers core syntax and data handling such as types and functions, integer and floating-point arithmetic, strings, variables and assignment, printing, input/output, and foundational control structures like loops and sequences.\"}]","Hands-on Python Tutorial - Release 2.0 | PDF",522,21,[147,151,155,159,163,167,171,175,179,183,187,192,197,202,207,212,217,222,227,231,235],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/6c9f9df4f3f10a1840fc2385efc34748.webp",983,1272,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/2fa633210cb10543fa643e47bba97767.webp",982,1270,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/09b775ee4702b4f82c1d0f0d9c9a4383.webp",981,1269,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/68746ccd8b4723c96364aef89716fd56.webp",980,1268,{"page_no":24,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a82a2d1021534cfcb9986a596cd68f2f.webp",979,1267,{"page_no":29,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/49dd5ce5ba29f46d5f539d32c57a6d2e.webp",978,1265,{"page_no":34,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/bb777141c1a4ca3e898caa2d22043b90.webp",977,1264,{"page_no":39,"url":176,"width":177,"height":178},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/bad24b6ad317e4c2a8e3740348436f55.webp",976,1263,{"page_no":44,"url":180,"width":181,"height":182},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a22f2b6cfc5fd5b91a78cee847b9eb86.webp",975,1261,{"page_no":52,"url":184,"width":185,"height":186},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/148de9352c942985a25e21277b21bc6f.webp",974,1260,{"page_no":188,"url":189,"width":190,"height":191},11,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/2c471ef8bdb30d2dcd24aeac6025ba93.webp",973,1259,{"page_no":193,"url":194,"width":195,"height":196},12,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/81e1dc420f734fcb8fd07b5da3125de4.webp",972,1257,{"page_no":198,"url":199,"width":200,"height":201},13,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/47653135055fadbe3b8e5794fcc67730.webp",971,1256,{"page_no":203,"url":204,"width":205,"height":206},14,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e73722480b480f10f213a87c2568a7de.webp",970,1255,{"page_no":208,"url":209,"width":210,"height":211},15,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/760cdd8158fe3c7a4dcb95979e2f6e82.webp",969,1254,{"page_no":213,"url":214,"width":215,"height":216},16,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/d56ce69874106aebbff0e0b727c70d51.webp",968,1252,{"page_no":218,"url":219,"width":220,"height":221},17,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/b77ff68c8b8b8642dbd27f558e9a44fe.webp",967,1251,{"page_no":223,"url":224,"width":225,"height":226},18,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/8b6c8ac3fdbc12408b71dad837bfa6c4.webp",966,1250,{"page_no":56,"url":228,"width":229,"height":230},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/d5f41e0ef4279c4f852e9cb1ba8927b6.webp",965,1248,{"page_no":46,"url":232,"width":233,"height":234},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/0a2fb8a93f9f2b2e7f06fffcfbaff9e5.webp",964,1247,{"page_no":145,"url":236,"width":237,"height":238},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/f778116f9a036c721e9c9b76a1a5d1df.webp",963,1246,{"list":240,"token":66},[241,247,253,259,265,271,277,283,289,295],{"doc_id":242,"doc_title":243,"file_type":137,"home_preview_img_url":244,"slug":245,"view_count":213,"category_name":30,"create_tm":246},671794,"Python Tutorial - Release 3.7.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988403939/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=LzftnMzPV9l2s7oaPtZPegtYIB8%3D","python-tutorial-release-370",1793580648,{"doc_id":248,"doc_title":249,"file_type":137,"home_preview_img_url":250,"slug":251,"view_count":198,"category_name":30,"create_tm":252},417793,"Python Programming Basics - Overview of Interpreters, Translation, and Key Vocabulary","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229921866711/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=rHxeA3Q9IN%2F1MTKInHxdPA2BZ2w%3D","python-programming-basics-overview-of-interpreters-translation-and-key-vocabulary",1790610644,{"doc_id":254,"doc_title":255,"file_type":137,"home_preview_img_url":256,"slug":257,"view_count":24,"category_name":30,"create_tm":258},692235,"Learning Python - Fourth Edition - Learn Python Programming","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003011256/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=RsCUFd6Ah2y4T6RhDWGO%2FzuUUZU%3D","learning-python-fourth-edition-learn-python-programming",1794186387,{"doc_id":260,"doc_title":261,"file_type":137,"home_preview_img_url":262,"slug":263,"view_count":19,"category_name":30,"create_tm":264},719777,"Python For Dummies - Introducing Python - Getting Started","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023659675/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=vuNDJKH71CFAEzckctsfvm%2F92ek%3D","python-for-dummies-introducing-python-getting-started",1795031061,{"doc_id":266,"doc_title":267,"file_type":137,"home_preview_img_url":268,"slug":269,"view_count":29,"category_name":30,"create_tm":270},670918,"The Python Cheat Sheet - Quick Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988353374/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=gKypxRzDW2SR5bnbyBIHA5Qicv4%3D","the-python-cheat-sheet-quick-reference",1793572702,{"doc_id":272,"doc_title":273,"file_type":137,"home_preview_img_url":274,"slug":275,"view_count":81,"category_name":30,"create_tm":276},697975,"Python Variable Types - Variable Assignment, Multiple Assignment, and Standard Data Types","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146715/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=OlYtJhHL%2BaOWK93Zp9ccEgxA84M%3D","python-variable-types-variable-assignment-multiple-assignment-and-standard-data-types",1794446554,{"doc_id":278,"doc_title":279,"file_type":137,"home_preview_img_url":280,"slug":281,"view_count":81,"category_name":30,"create_tm":282},682644,"Visual QuickStart Guide - Python - Third Edition - Learn the quick and easy way","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999674919/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=LbBuvdCDzxXD3XtSp2c2HN2opng%3D","visual-quickstart-guide-python-third-edition-learn-the-quick-and-easy-way",1793977303,{"doc_id":284,"doc_title":285,"file_type":137,"home_preview_img_url":286,"slug":287,"view_count":24,"category_name":30,"create_tm":288},685779,"Topic 6 - Lists, Sets, Tuples, Dictionaries","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203959/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=xVKw9jvyay%2B2nO8u4TW%2BRYqZzU8%3D","topic-6-lists-sets-tuples-dictionaries",1794018231,{"doc_id":290,"doc_title":291,"file_type":137,"home_preview_img_url":292,"slug":293,"view_count":29,"category_name":30,"create_tm":294},692236,"Python Tutorial - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003011327/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=JGfDqPSDeRTw7STT4A9Rf6rWRtQ%3D","python-tutorial-introduction",1794186391,{"doc_id":296,"doc_title":297,"file_type":137,"home_preview_img_url":298,"slug":299,"view_count":52,"category_name":30,"create_tm":300},692230,"Python Handbook - Updated October 14, 2026","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003011060/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=qu0ViJZb44oXG0wVcyCMRhK97Z0%3D","python-handbook-updated-october-14-2026",1794186375]