[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-detail-670917-en":59,"doc-seo-670917-105":88,"doc-similar-670917":152},{"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":5,"data":60},{"doc_id":61,"user_id":62,"nickname":63,"user_avatar":64,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":66,"doc_content":67,"file_id":68,"file_url":69,"file_type":70,"file_size":71,"view_count":34,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":14,"language":72,"language_code":73,"site_id":74,"html_lang":73,"table_of_contents":75,"faqs":76,"seo_title":77,"seo_description":66,"update_tm":78,"read_time":24,"preview_page_count":14,"preview_urls":79},670917,2336477552062,"Stanford","https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","Python 3 Cheat Sheet - concise reference","Python 3 Cheat Sheet provides a compact, practical reference for core language elements and common idioms. It summarizes base types (integers, floats, booleans, strings, bytes), immutable and mutable containers (tuples, lists, dictionaries, sets, frozensets), variable assignment and unpacking, numeric and type conversions, and essential string and sequence operations such as splitting and joining. The sheet also covers indexing and slicing rules, boolean logic and comparators, control-flow blocks, operator precedence, and basic standard-library math usage with module import patterns.","©2012-2015-Laurent Pointal Mémento v2 .0.5 License Creative Commons Attribution 4  \nPython 3 Cheat Sheet  \nLatest version on :  \n[https://perso.limsi.fr/pointal/python:memento](https://perso.limsi.fr/pointal/python:memento)  \n\n| integer, float, boolean, string, bytes\u003Cbr>int float\u003Cbr>783 0 -192 0b010\u003Cbr>null binary\u003Cbr>9.23 0.0 -1 .7e-6 \u003Cbr>\u003Cbr>Base Types\u003Cbr>0o642 0xF3\u003Cbr>octal hexa\u003Cbr>bool True False str \"One\\nTwo\"\u003Cbr>escaped new  line\u003Cbr>'I\\'m'\u003Cbr>escaped '\u003Cbr>\u003Cbr> ×10-6\u003Cbr>Multiline string:\u003Cbr>\"\"\"X\\tY\\tZ 1\\t2\\t3\"\"\"\u003Cbr>escaped tab\u003Cbr>\u003Cbr>\u003Cbr>bytes b\"toto\\xfe  \\775  \"\u003Cbr>hexadecimal  octal ☝ immutables |  |  | ◾ ordered sequences, fast index access, repeatable values\u003Cbr>\u003Cbr>\u003Cbr>list [1 ,5 , 9] [ \"x\" ,11 ,8.9] [\"mot\"]\u003Cbr> tuple (1 ,5 , 9) 11 , \"y\" , 7.4  (\"mot\",) Non modifiable values (immutables) ☝ expression with just comas →tuple\u003Cbr> str bytes (ordered sequences of chars / bytes)◾ key containers, no a priori order, fast key acces, each key is unique dictionary dict { \"key\": \"value\"} dict (a=3 ,b=4 ,k= \"v\")(key/value associations) {1 : \"one\" ,3 :\"three\" ,2 :\"two\" ,3.14 : \"π \" } collection set { \"key1\" , \"key2\"} {1 , 9 ,3 ,0}☝ keys=hashable values (base types, immutables…) frozenset immutable set\u003Cbr>\u003Cbr>[]\u003Cbr>()\u003Cbr>\"\"b\"\"\u003Cbr>{}\u003Cbr>set ()\u003Cbr>empty\u003Cbr>|  |\n| --- | --- | --- | --- | --- |\n| for variables, functions,  Identifiers  modules, classes…names\u003Cbr>a…zA…Z_ followed by a…zA…Z_0…9 ◽ diacritics allowed but should be avoided ◽ language keywords forbidden\u003Cbr>◽ lower/UPPER case discrimination ☺ a toto x7 y_max BigOne ☹ ~~8y~~ ~~and~~ ~~for~~ |  | int (\"15\") → 15\u003Cbr>int ( \"3f\" , 16) → 63\u003Cbr>int (15.56) → 15 |  | type (expression)  Conversions  can specify integer number base in 2nd parameter truncate decimal part |\n|  |  | float ( \"-11.24e8\") → -1124000000.0\u003Cbr>round (15.56 , 1)→ 15.6 rounding to 1 decimal (0 decimal → integer number) bool (x) False for null x, empty container x , None or False x ; True for other x str (x)→ \"…\" representation string of x for display (cf. formating on the back)\u003Cbr>chr (64)→ '@' ord ( '@' )→64 code ↔ char\u003Cbr>repr (x)→ \"…\" literal representation string of x bytes ([72 , 9 , 64]) → b'H\\t@'list (\"abc\") → [ 'a' , 'b' , 'c' ]\u003Cbr>dict ([(3 , \"three\"),(1 , \"one\")]) → {1 : 'one' ,3 : 'three' } set ([ \"one\" , \"two\"]) → { 'one' , 'two' }\u003Cbr>separator str and sequence of str → assembled str\u003Cbr>':' .join (['toto','12','pswd'] ) → 'toto:12:pswd'str splitted on whitespaces → list of str\u003Cbr>\"words with spaces\" .split () → [ 'words' , 'with' , 'spaces' ] str splitted on separator str → list of str\u003Cbr>\"1,4,8,2\" .split (\",\") → [ '1' , '4' , '8' , '2' ] sequence of one type → list of another type (via comprehension list)\u003Cbr>[int (x) for x in ( '1' , '29' , ' -3' )] → [1 ,29 ,-3] |  |  |\n| = Variables assignment |  |  |  |  |\n| ☝ assignment ⇔ binding of a name with a value\u003Cbr>1) evaluation of right side expression value\u003Cbr>2) assignment in order with left side names\u003Cbr>x= 1.2+8+sin (y) a=b=c= 0 assignment to same value\u003Cbr>y , z ,r= 9.2 ,-7.6 , 0 multiple assignmentsa ,b=b ,a values swap\u003Cbr>a , *b=seq  unpacking of sequence in\u003Cbr>*a ,b=seq  item and list\u003Cbr>\u003Cbr>x+=3 increment ⇔ x=x+3 x-=2 decrement ⇔ x=x-2 x=None « undefined » constant value del x remove name x\u003Cbr>and\u003Cbr>*=\u003Cbr>/=%=\u003Cbr>… |  |  |  |  |\n| for lists, tuples, strings, bytes… Sequence Containers Indexing\u003Cbr>negative index\u003Cbr>positive index\u003Cbr>lst=\u003Cbr>positive slice\u003Cbr>negative slice - -5\u003Cbr>0\u003Cbr>[10,\u003Cbr>0\u003Cbr>5 - -4\u003Cbr>1\u003Cbr>20,\u003Cbr>1\u003Cbr>4 - -3\u003Cbr>2\u003Cbr>30 ,\u003Cbr>2\u003Cbr>3 - -2\u003Cbr>32\u003Cbr>3\u003Cbr>40 ,\u003Cbr>4\u003Cbr>- -1\u003Cbr>4\u003Cbr>50]\u003Cbr>5\u003Cbr>1\u003Cbr>Access to sub-sequences via lst [start slice:end slice:step]\u003Cbr>Items count\u003Cbr>len (lst)→5\u003Cbr>☝ index from 0\u003Cbr>(here from 0 to 4)\u003Cbr>lst [ :-1]→ [10,20,30,40]\u003Cbr>lst [1 :-1]→ [20,30,40]\u003Cbr>lst [ ::-1]→ [50,40,30,20,10] lst [ ::-2]→ [50,30,10]\u003Cbr>Individual access to items via lst [index]\u003Cbr>lst [0]→10 ⇒ first one lst [1]→20\u003Cbr>lst [-1]→50 ⇒ last one lst [-2]→40\u003Cbr>On mutable sequences (list), remove with del lst [3] and modify with assign","cbCaicILxX0IJgRt","https://ap.wps.com/l/cbCaicILxX0IJgRt","pdf",249052,"English","en",105,"# Base Types and Containers\n## Strings, bytes, and escaping\n## Lists, tuples, dicts, sets\n# Variables and Expressions\n## Assignment, unpacking, and increments\n## Type conversions and rounding\n## Operators and precedence\n# Sequences, Indexing, and Slicing\n## Negative indexing and steps\n## Copying and deletion/modification\n# Boolean Logic and Control Flow\n## Comparators and logical operators\n## if / elif / else blocks\n# Modules and Math Basics\n## Import patterns\n## math functions and constants","[{\"question\":\"What Python 3 base types are covered in the cheat sheet?\",\"answer\":\"It covers integers, floats, booleans, strings, and bytes, including example literals and escaping rules for strings.\"},{\"question\":\"How does the cheat sheet explain slicing for lists and other sequences?\",\"answer\":\"It uses the format lst[start:end:step], demonstrates positive and negative indices, and shows how omitting start/end defaults to the sequence bounds.\"},{\"question\":\"What should you know about boolean logic and control flow?\",\"answer\":\"It describes comparators, logical operators (and/or/not), and emphasizes the pitfall of and/or returning non-boolean values, then provides the if/elif/else block structure with indentation.\"}]","Python 3 Cheat Sheet - concise reference | PDF",1793572698,[80,84],{"page_no":8,"url":81,"width":82,"height":83},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/9428a028b29d9de472be6a899725004f.webp",983,1390,{"page_no":14,"url":85,"width":86,"height":87},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/9edd620131e2f2627d6c3f15960c92ba.webp",982,1389,{"code":4,"msg":89,"data":90},"ok",{"site_id":74,"language":73,"slug":91,"title":65,"keywords":92,"description":66,"schema_data":93,"social_meta":147,"head_meta":149,"extra_data":151,"updated_unix":78},"python-3-cheat-sheet-concise-reference","",{"@graph":94,"@context":146},[95,109,129],{"@type":96,"itemListElement":97},"BreadcrumbList",[98,102,104,107],{"item":99,"name":100,"@type":101,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":103,"name":9,"@type":101,"position":14},"https://docshare.wps.com/document/",{"item":105,"name":30,"@type":101,"position":106},"https://docshare.wps.com/document/technology/",3,{"item":108,"name":65,"@type":101,"position":19},"https://docshare.wps.com/document/python-3-cheat-sheet-concise-reference/670917/",{"url":108,"name":65,"@type":110,"image":111,"author":116,"headline":65,"publisher":118,"fileFormat":121,"inLanguage":73,"description":66,"dateModified":122,"datePublished":123,"encodingFormat":121,"isAccessibleForFree":124,"interactionStatistic":125},"DigitalDocument",{"url":112,"@type":113,"width":114,"height":115},"https://docshare.wps.com/thumbnails/python-3-cheat-sheet-concise-reference/670917.png","ImageObject",300,407,{"name":63,"@type":117},"Person",{"url":99,"name":119,"@type":120},"DocShare","Organization","application/pdf","2026-11-18","2026-11-01",true,{"@type":126,"interactionType":127,"userInteractionCount":34},"InteractionCounter",{"@type":128},"ViewAction",{"@type":130,"mainEntity":131},"FAQPage",[132,138,142],{"name":133,"@type":134,"acceptedAnswer":135},"What Python 3 base types are covered in the cheat sheet?","Question",{"text":136,"@type":137},"It covers integers, floats, booleans, strings, and bytes, including example literals and escaping rules for strings.","Answer",{"name":139,"@type":134,"acceptedAnswer":140},"How does the cheat sheet explain slicing for lists and other sequences?",{"text":141,"@type":137},"It uses the format lst[start:end:step], demonstrates positive and negative indices, and shows how omitting start/end defaults to the sequence bounds.",{"name":143,"@type":134,"acceptedAnswer":144},"What should you know about boolean logic and control flow?",{"text":145,"@type":137},"It describes comparators, logical operators (and/or/not), and emphasizes the pitfall of and/or returning non-boolean values, then provides the if/elif/else block structure with indentation.","https://schema.org",{"og:url":108,"og:type":148,"og:title":65,"og:site_name":119,"og:description":66},"article",{"robots":150,"canonical":108},"index,follow",{"doc_id":61,"site_id":74},{"list":153,"token":92},[154,160,166,172,178,184,190,196,202,208],{"doc_id":155,"doc_title":156,"file_type":70,"home_preview_img_url":157,"slug":158,"view_count":24,"category_name":30,"create_tm":159},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":161,"doc_title":162,"file_type":70,"home_preview_img_url":163,"slug":164,"view_count":34,"category_name":30,"create_tm":165},697976,"6.0001 Lecture 5 - Tuples, Lists, Aliasing, Mutability, Cloning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146768/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=SENBcerOmy3WNGB90%2Bb9nOedtF8%3D","60001-lecture-5-tuples-lists-aliasing-mutability-cloning",1794446554,{"doc_id":167,"doc_title":168,"file_type":70,"home_preview_img_url":169,"slug":170,"view_count":106,"category_name":30,"create_tm":171},685772,"UNIT-IV - LIST, TUPLES, DICTIONARIES - Problem Solving and Python Programming","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203776/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=HkvxzSYwEXqQ8thGlmT1p0noUsU%3D","unit-iv-list-tuples-dictionaries-problem-solving-and-python-programming",1794018219,{"doc_id":173,"doc_title":174,"file_type":70,"home_preview_img_url":175,"slug":176,"view_count":29,"category_name":30,"create_tm":177},697978,"Lecture 4: Tuples, List Slicing, List Comprehension, Strings","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146771/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=Wvz6zlSWxDmO1VACn%2BvUBKF8%2B44%3D","lecture-4-tuples-list-slicing-list-comprehension-strings",1794446559,{"doc_id":179,"doc_title":180,"file_type":70,"home_preview_img_url":181,"slug":182,"view_count":29,"category_name":30,"create_tm":183},685629,"Chapter 2: Lists, Arrays and Dictionaries","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999084017/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=9EIh52i3jWx3cuy3KSDZWsFbePo%3D","chapter-2-lists-arrays-and-dictionaries",1794016092,{"doc_id":185,"doc_title":186,"file_type":70,"home_preview_img_url":187,"slug":188,"view_count":106,"category_name":30,"create_tm":189},685777,"Lists and Tuples - Learn to create and use 1D lists, tuples and 2D lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203949/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=Q567A6l9djmtSX4b6Q3vvmeUHFY%3D","lists-and-tuples-learn-to-create-and-use-1d-lists-tuples-and-2d-lists",1794018226,{"doc_id":191,"doc_title":192,"file_type":70,"home_preview_img_url":193,"slug":194,"view_count":19,"category_name":30,"create_tm":195},685780,"Tuple in Python - Lecture 2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203975/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=WFfLN1seOyz1WFg5wT4sYhtfWJg%3D","tuple-in-python-lecture-2",1794018232,{"doc_id":197,"doc_title":198,"file_type":70,"home_preview_img_url":199,"slug":200,"view_count":19,"category_name":30,"create_tm":201},697980,"TUPLES AND DICTIONARIES - Introduction to Tuples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146829/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=IguPqX%2FBwXJsq0q%2Bqn4bNKjPeW4%3D","tuples-and-dictionaries-introduction-to-tuples",1794446564,{"doc_id":203,"doc_title":204,"file_type":70,"home_preview_img_url":205,"slug":206,"view_count":24,"category_name":30,"create_tm":207},685778,"1-Tuples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203953/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=glzjV5ZG7FMh%2B5YLzAf9wQPnyeU%3D","1-tuples",1794018230,{"doc_id":209,"doc_title":210,"file_type":70,"home_preview_img_url":211,"slug":212,"view_count":106,"category_name":30,"create_tm":165},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"]