[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571756-105":53,"doc-detail-571756-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","python-3-cheat-sheet-quick-reference","Python 3 Cheat Sheet - Quick reference","","Python 3 Cheat Sheet provides a compact reference for core language elements: built-in base types, literals and escaping rules, common conversions, string assembly and splitting, container types (list, tuple, dict, set, frozenset) and their indexing/slicing behavior. It also summarizes variable assignment and unpacking, numeric operations and operator precedence, boolean logic and comparisons, conditional blocks with if/elif/else, and basic module usage with imports. Ideal for rapid lookups while coding.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/python-3-cheat-sheet-quick-reference/571756/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/python-3-cheat-sheet-quick-reference/571756.png","ImageObject",442,249,{"name":88,"@type":89},"Aran","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",7,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What are Python 3 base types and how are literals represented?","Question",{"text":109,"@type":110},"The sheet lists integer, float, boolean, string, and bytes along with examples of escape sequences and multiline strings.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How do lists, tuples, strings, and bytes indexing and slicing work?",{"text":114,"@type":110},"It explains zero-based indexing, negative indices, and slice syntax lst[start:end:step], including examples for omitted bounds and step reversal.",{"name":116,"@type":107,"acceptedAnswer":117},"What are the key rules for variable assignment and unpacking?",{"text":118,"@type":110},"It covers binding names to values, chained assignments, multiple assignment with commas, and sequence unpacking including starred targets, plus common increment/decrement and deletion with del.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},571756,1792033110,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":9},137455076865,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","©2012-2015-Laurent Pointal Mémento v2 .0.6 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>zero 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 only comas →tuple\u003Cbr> str bytes (ordered sequences of chars / bytes)◾ key containers, no a priori order, fast key access, 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. formatting 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 list comprehension)\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 assi","cbCaihrUzvlgjyDv","https://ap.wps.com/l/cbCaihrUzvlgjyDv","pdf",248523,"English","# Base Types\n## Containers and indexing\n# Conversions and operators\n## Boolean logic and comparisons\n# Statements and control flow\n## Modules and imports","[{\"question\":\"What are Python 3 base types and how are literals represented?\",\"answer\":\"The sheet lists integer, float, boolean, string, and bytes along with examples of escape sequences and multiline strings.\"},{\"question\":\"How do lists, tuples, strings, and bytes indexing and slicing work?\",\"answer\":\"It explains zero-based indexing, negative indices, and slice syntax lst[start:end:step], including examples for omitted bounds and step reversal.\"},{\"question\":\"What are the key rules for variable assignment and unpacking?\",\"answer\":\"It covers binding names to values, chained assignments, multiple assignment with commas, and sequence unpacking including starred targets, plus common increment/decrement and deletion with del.\"}]","Python 3 Cheat Sheet - Quick reference | PDF",1791923594]