[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-682220-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-682220-en":130,"doc-similar-682220":153},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","style-guide-for-cs-231-and-cs-234-python-style-requirements","Style Guide for CS 231 and CS 234 - Python Style Requirements","","Style Guide for CS 231 and CS 234 documents the Python coding conventions required for course submissions. It specifies formatting rules for assignment files, including an assignment header, the ordering of components, and disciplined use of comments. It also outlines blank lines, indentation, identifier naming conventions, and line-length expectations. The guide further describes the design recipe approach and connects style practices to grading to ensure consistent readability and correct intent expression in code.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/style-guide-for-cs-231-and-cs-234-python-style-requirements/682220/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/style-guide-for-cs-231-and-cs-234-python-style-requirements/682220.png","ImageObject",300,407,{"name":42,"@type":43},"Stanley","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-26","2026-11-06",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",6,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What style should be used for course submissions unless otherwise specified?","Question",{"text":63,"@type":64},"Use the style presented in this guide for all work submitted for the course, unless the document explicitly specifies a different requirement.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What is the recommended order of components in an assignment file?",{"text":68,"@type":64},"Start with an assignment header, then include import statements (if any), definitions of user-defined types (if any), constant definitions, helper functions, and finally the main program/function.",{"name":70,"@type":61,"acceptedAnswer":71},"What indentation, line length, and comment practices are required?",{"text":72,"@type":64},"Use four spaces per indentation level, keep lines around 70 characters and never exceed 80, and write comments using # or ## (with the remainder of the line ignored). Comments should be sparing and aligned with the design recipe structure.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},682220,1793963013,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":55,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":127,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":80,"read_time":143,"preview_page_count":26,"preview_urls":144},2336477405376,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","Style Guide for CS 231 and CS 234  \nNaomi Nishimura  \nJuly 8, 2019  \n1 Introduction  \nThis document speciﬁes the style required for Python programs written for the course. It assumes familiarity with the design recipe, as discussed in detail in CS 115, CS 116, CS 135, and CS 136, and uses standards set out for Python in PEP 8 – Style Guide for Python Code ( [legacy. python. org/dev/peps/pep-0008](legacy. python. org/dev/peps/pep-0008)).  \nYou may ﬁnd discrepancies among the styles used in the textbook, in course materials (where examples may be condensed for the sake of concision), and in this guide. Unless speciﬁed otherwise, you should always use the style presented in this guide on all work submitted for the course.  \nThis guide includes general principles for the formatting of assignments (Section 2), details of the design recipe (Section 3), detailed instructions for testing (Section 4), guidelines for deﬁnitions of user-designed types (Section 5), and sample submissions that satisfy style requirements (Section 6) .  \n2 Assignment format  \nEach assignment should start with an assignment header, include comments, and make use of various techniques for enhancing readability.  \n2.1 Assignment header and order of components  \nStart each assignment ﬁle with an assignment header to identify yourself, the term, the assignment, and the problem. While there is no speciﬁc required format, the information should be presented in a clear manner, such as in the example below:  \n\\#\\#  \n\\#\\# =======================================================  \n\\#\\# Ima Student (12345678)\\#\\# CS 231 Spring 2018  \n\\#\\# Assignment 03, Problem 4 \\#\\# =======================================================\\#\\#  \nThe remainder of the ﬁle should appear in the following order, with documentation for each function (discussed in detail in Section 3) appearing before the function deﬁnition: assignment header, import statements (if any), deﬁnitions of user-deﬁned types (if any), constant deﬁnitions, helper functions, main program/ -function.  \nUser-deﬁned types (especially classes) are particularly important in CS 234; be sure to read Section 5 carefully to ensure that you follow the proper format.  \n2.2 Comments  \nMost of the comments you provide will appear in a block at the beginning of a function, as dictated by the design recipe. Part of the marks for each assignment will be allocated for such comments.  \nAdditional comments should be used sparingly to indicate your intentions, such as the use of local variables, branching, and loops. Any such comment can either be put on its own line, or tacked onto the end of a line of code, providing it ﬁts.  \nIn Python, use \\#\\# or \\# to indicate the start of a comment. Either is acceptable. The rest of the line will be ignored.  \n2.3 Blank lines, layout, indentation, and line length  \nBlank lines can be used to group related information and set it apart from other components, such as the documentation for a function, a function deﬁnition, or a class deﬁnition. An alternative way of separating information is the use of a row of = 's or other symbols, as used in the assignment header.  \nIf the question asks you to write more than one function, the ﬁle should contain them in the order speciﬁed by the assignment. Helper functions should be put with the function they are helping. Typically, helper functions are placed before the main function, though at times other locations may be acceptable: remember that the goal is to make it easy for the reader to determine where your functions are located.  \nThe use of indentation of Python code reﬂects not only style but syntax, as levels of indentation are used to indicate the relationships among lines of code. In order to have a visually-pleasing layout, use four spaces for each level of indentation of code. Indentation should also be used in comments in order to indicate that lines belong to the same part of the documentation.  \nTry not to let your lines get longer than about 70 ","cbCaikJh7NJm6sU7","https://ap.wps.com/l/cbCaikJh7NJm6sU7","pdf",111565,"English","# 1 Introduction\n# 2 Assignment format\n## 2.1 Assignment header and order of components\n## 2.2 Comments\n## 2.3 Blank lines, layout, indentation, and line length\n## 2.4 Identifiers\n# 3 The design recipe","[{\"question\":\"What style should be used for course submissions unless otherwise specified?\",\"answer\":\"Use the style presented in this guide for all work submitted for the course, unless the document explicitly specifies a different requirement.\"},{\"question\":\"What is the recommended order of components in an assignment file?\",\"answer\":\"Start with an assignment header, then include import statements (if any), definitions of user-defined types (if any), constant definitions, helper functions, and finally the main program/function.\"},{\"question\":\"What indentation, line length, and comment practices are required?\",\"answer\":\"Use four spaces per indentation level, keep lines around 70 characters and never exceed 80, and write comments using # or ## (with the remainder of the line ignored). Comments should be sparing and aligned with the design recipe structure.\"}]","Style Guide for CS 231 and CS 234 - Python Style Requirements | PDF",48,[145,149],{"page_no":22,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-06/b4c53f974733219a95bc1f3ffd608cbb.webp",983,1272,{"page_no":26,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-06/e63bf8e5435c171942eed68427056d89.webp",982,1270,{"list":154,"token":11},[155,161,167,173,179,185,191,197,203,209],{"doc_id":156,"doc_title":157,"file_type":137,"home_preview_img_url":158,"slug":159,"view_count":105,"category_name":29,"create_tm":160},692314,"CS 116 Course Specific Style Guide - Document","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003205286/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=YDqo3vridAWP%2FuEqMeltXa0yfvk%3D","cs-116-course-specific-style-guide-document",1794193120,{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":55,"category_name":29,"create_tm":166},672868,"Google's R Style Guide - Coding Style Rules","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990161141/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=OfAm%2BJmhPdAgxTrGcRd6id2kBJE%3D","googles-r-style-guide-coding-style-rules",1793611796,{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":33,"category_name":29,"create_tm":172},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=1796110619&Signature=dvN1oy2K2wRwn%2BvH3p%2Bn%2BDnrKMY%3D","a-python-style-guide-draft",1793963006,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":97,"category_name":29,"create_tm":178},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=1796110619&Signature=nCVeTr%2FoQKZoeOARnM%2B42mCQGnE%3D","python-pep8-the-style-guide-for-python-code",1793963024,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":30,"category_name":29,"create_tm":184},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=1796110619&Signature=DQUcK0gx%2BmCc5XwxZfm28ff3BQA%3D","python-code-style-guide-introduction-format-and-use-of-white-space",1793963005,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":55,"category_name":29,"create_tm":190},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=1796110619&Signature=8smcPs1vWAqCfnZo4QNawdRZirg%3D","python-pep8-style-guide-cheat-sheet-naming-conventions-maximum-line-length-and-line-breaking-indentation-comments-code-layout",1793963021,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":55,"category_name":29,"create_tm":196},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=1796110619&Signature=N3ajdpsukICvVWTIdg3rNkctq24%3D","python-style-rules-docstring-conventions-coding-style",1793963012,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":97,"category_name":29,"create_tm":202},692315,"Good Coding Practices - Python Code Best Practices","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002739157/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=zs1CLI%2B5giXQ4uDkF6lw4Q%2F4LZM%3D","good-coding-practices-python-code-best-practices",1794193122,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":33,"category_name":29,"create_tm":208},700988,"Java Code Conventions - 1997-09-12 - Copyright and code style guidelines","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012045653/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110619&Signature=oTp5I6hYObnlmL8fQTmb2oGXQBg%3D","java-code-conventions-1997-09-12-copyright-and-code-style-guidelines",1794522632,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":115,"category_name":29,"create_tm":214},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=1796110619&Signature=JFCG8s56WzGc3EBLsI86jDQ7NGk%3D","python-quick-guide-beginner-start-here",1794186385]