[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-692314-105":59,"doc-detail-692314-en":130,"doc-similar-692314":166},{"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","cs-116-course-specific-style-guide-document","CS 116 Course Specific Style Guide - Document","","CS 116 Course Specific Style Guide explains how to write assignment code with clear style and stronger readability for graders. It covers communication goals behind good formatting: comments, whitespace, indentation, layout, and naming conventions. It also details Python-specific requirements, including ASCII-only text to avoid auto-grader issues, consistent indentation with either 2 or 4 spaces, correct placement and ordering of import statements, spacing rules between functions, line-length limits, comment syntax, header templates, and docstring placement and usage.",{"@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/cs-116-course-specific-style-guide-document/692314/",{"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/cs-116-course-specific-style-guide-document/692314.png","ImageObject",300,407,{"name":92,"@type":93},"Lucas Martin","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-30","2026-11-09",true,{"@type":102,"interactionType":103,"userInteractionCount":34},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Why does the guide emphasize code style if it doesn’t change program execution?","Question",{"text":112,"@type":113},"Code style improves readability and extensibility. The guide frames it as a communication goal so graders can understand the work quickly and accurately.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What formatting rules does the guide give for Python indentation and whitespace?",{"text":117,"@type":113},"It requires consistent indentation using either 2 spaces or 4 spaces across assignments, and forbids mixing tabs and spaces. It also specifies layout rules such as blank lines after imports and between function definitions.",{"name":119,"@type":110,"acceptedAnswer":120},"What comment and documentation approach does the guide recommend for Python functions?",{"text":121,"@type":113},"It instructs using # # for full-line comments and # for inline comments, and recommends using docstrings placed directly after the function header, with examples of multi-line triple-single-quote strings.","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},692314,1794193120,{"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":34,"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":24,"preview_urls":145},8796095360427,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","Computer Science @ The University of Waterloo  \nCS 116  \nCourse Speciﬁc Style Guide  \nLast Updated: 2021.09.25  \n1 Introduction  \nThe code you submit for assignments, as with all code you write, can be made more readable and useful by paying attention to style. This includes the placement of comments, whitespace, indentation, and choice of variable and function names. None of these things affect the execution of a program, but they affect its readability and extensibility. As in writing English prose, the goal is communication, and you need to think of the needs of the reader. This is especially important when the reader is assigning you a grade.  \nThis document will help explain the course speciﬁc changes needed for CS 116. This document will also include speciﬁc examples outlining how the style guide should look for this course.  \n2 Assignment Formatting Changes  \nWith Python, functions that we write can now do more than simply produce a value. With mutation, a function can change the value of list, dictionary, or object arguments, or have other effects. While allowing programs to do even more, the introduction of mutation requires changes to some steps of our design recipe, along with the introduction of a new step. These changes will be introduced module by module following this preamble.  \n2.1 Warning About Copying and Pasting  \nCopying and pasting can make your assignment unmarkable. It may lead to characters appearing in code that our auto graders cannot read correctly and hence will be marked as incorrect. Do not include anything other than ASCII characters (characters found on a standard US keyboard) into your text ﬁles.  \n2.2 Whitespace, Indentation and Layout  \nAs Python is an indentation language, whitespace will largely be forced by the structure of the language. Be consistent and either use two spaces for indentation or 4 spaces throughout all of your assignments. Do not mix tab characters and spaces as it will cause errors when running in Python. Always use spaces (check your IDE for instructions as to how to make your tab character type in spaces instead of tab characters) . Also note that import calls should appear one line after the header and should be listed in alphabetical order. Two blank lines should follow these calls. Two blank lines should also be between function deﬁnitions.  \nIf the question asks you to write more than one function, the ﬁle should contain them in the order speciﬁed by the assignment. Follow the convention of placing helper functions above the assignment function(s) they are helping. Remember that the goal is to make it easier for the reader to determine where your functions are located.  \nWhen to start a new line (hit enter or return) is a matter of judgment. Try not to let your lines get longer than about 70 characters, and deﬁnitely no longer than 80 characters. You do not want your code to look too horizontal, or too vertical. You may extend a line by using a backslash character n in Python or if a previous line ends with a open parenthesis that has no corresponding close parenthesis, you may continue the line by hitting enter (and eventually typing the closing parenthesis ﬁnishing the extended line) .  \nStyle marks may be deducted if you exceed 80 characters on any line of your assignment.  \n2.3 Comments  \nIn Python, use \\#\\# or \\# to indicate the start of a comment. Use \\#\\# for full line comments and \\# for in-line comments. The rest ofthe line will be ignored. Use inline comments sparingly. If you are using standard design recipes and templates, and following the rest ofthe guidelines here, you should not need many additional comments. Any such comment can either be put on its own line, or tacked onto the end of a line of code, providing it ﬁts.  \nRacket programs were generally short enough that the design recipe steps provided sufﬁcient documentation about the program. It is more common to add comments in the function body when using imperative languages like Python. While t","cbCairrDlOug8mpd","https://ap.wps.com/l/cbCairrDlOug8mpd","pdf",156890,44,"English","# 1 Introduction\n# 2 Assignment Formatting Changes\n## 2.1 Warning About Copying and Pasting\n## 2.2 Whitespace, Indentation and Layout\n## 2.3 Comments\n## 2.4 Headers\n## 2.5 Function Header-Python's Docstring\n## 2.6 Constant (Variable) and Function Identifiers","[{\"question\":\"Why does the guide emphasize code style if it doesn’t change program execution?\",\"answer\":\"Code style improves readability and extensibility. The guide frames it as a communication goal so graders can understand the work quickly and accurately.\"},{\"question\":\"What formatting rules does the guide give for Python indentation and whitespace?\",\"answer\":\"It requires consistent indentation using either 2 spaces or 4 spaces across assignments, and forbids mixing tabs and spaces. It also specifies layout rules such as blank lines after imports and between function definitions.\"},{\"question\":\"What comment and documentation approach does the guide recommend for Python functions?\",\"answer\":\"It instructs using # # for full-line comments and # for inline comments, and recommends using docstrings placed directly after the function header, with examples of multi-line triple-single-quote strings.\"}]","CS 116 Course Specific Style Guide - Document | PDF",111,[146,150,154,158,162],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/7d99dcca050c15fe058c04dcf7fd7e97.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/8a120a53cd2a9625879af9d334b88d42.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e483016b48b03fa9ed83375f7dfffb43.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/83af21e8378f5a9a20458fdf7d72e0d0.webp",980,1268,{"page_no":24,"url":163,"width":164,"height":165},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/b100d5e1d6a5d50da3eff956cc7239cf.webp",979,1267,{"list":167,"token":66},[168,174,180,186,192,198,204,210,216,222],{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":29,"category_name":30,"create_tm":173},682220,"Style Guide for CS 231 and CS 234 - Python Style Requirements","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448640/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=TyMSfUlfm0J1bnQ3StCoh2BURBo%3D","style-guide-for-cs-231-and-cs-234-python-style-requirements",1793963013,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":81,"category_name":30,"create_tm":179},682216,"Python Code Style Guide - Introduction - Format and use of White Space","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999427657/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=0rCWsjJ14g7qjVBkcmUE%2BdIpRF4%3D","python-code-style-guide-introduction-format-and-use-of-white-space",1793963005,{"doc_id":181,"doc_title":182,"file_type":137,"home_preview_img_url":183,"slug":184,"view_count":19,"category_name":30,"create_tm":185},682217,"A Python Style Guide - Draft","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448576/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=QtGpxWOpdtO1xvOsBKd6FYJoPW8%3D","a-python-style-guide-draft",1793963006,{"doc_id":187,"doc_title":188,"file_type":137,"home_preview_img_url":189,"slug":190,"view_count":29,"category_name":30,"create_tm":191},682219,"Python Style Rules - Docstring Conventions - Coding Style","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448620/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=QRgKz48gxZkApPwHtPKmiQnipic%3D","python-style-rules-docstring-conventions-coding-style",1793963012,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":24,"category_name":30,"create_tm":197},682224,"Python PEP8 - The Style Guide for Python Code","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999427682/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=eIA5LEdJuKkif88j1e7b0CwDeao%3D","python-pep8-the-style-guide-for-python-code",1793963024,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":29,"category_name":30,"create_tm":203},682223,"Python PEP8 style guide - Cheat Sheet - Naming conventions - Maximum Line Length and Line Breaking - Indentation - Comments - Code Layout","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999427735/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=hE4IC0RMCdV3JSdRgGg%2Bpt%2Flyz0%3D","python-pep8-style-guide-cheat-sheet-naming-conventions-maximum-line-length-and-line-breaking-indentation-comments-code-layout",1793963021,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":44,"category_name":30,"create_tm":209},692234,"PYTHON-QUICK GUIDE - Beginner - Start Here","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003011241/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=9kysO%2BmI01bmMcP1AgHNb6gYOls%3D","python-quick-guide-beginner-start-here",1794186385,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":29,"category_name":30,"create_tm":215},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=1796112059&Signature=PHZDw3s7nWl6BUFkk%2FYA8Uy9vxM%3D","the-python-cheat-sheet-quick-reference",1793572702,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":24,"category_name":30,"create_tm":221},670915,"Python Cheat Sheet - Quick Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988353347/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=ctdszm6xNYEyo8tLlvZi0PK1WOg%3D","python-cheat-sheet-quick-reference-670915",1793572692,{"doc_id":223,"doc_title":224,"file_type":137,"home_preview_img_url":225,"slug":226,"view_count":227,"category_name":30,"create_tm":228},391232,"Python Interview Questions - List vs Tuples - Key Features","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917654344/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112059&Signature=ZssxIWuFlBqtJhEig8Fe71vrhzw%3D","python-interview-questions-list-vs-tuples-key-features",15,1790350253]