[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571393-105":53,"doc-detail-571393-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","container-types-python3-guide","Container Types - Python3 Guide","","Python data types and container behaviors covering ordered sequences and mappings, including ordered lists/tuples/strings, sets, and dictionaries. Explains literals and common operations for bool, str, list, dict, and set, plus conversions and numeric handling such as int/float truncation. Details indexing and slicing with positive and negative ranges, sequence length, iteration patterns (if, for, while), and typical container operators. Includes list mutation and sequence utilities like append, extend, insert, remove, pop, sort, reverse, and basic file-read/readback topics.",{"@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/container-types-python3-guide/571393/",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/container-types-python3-guide/571393.png","ImageObject",442,249,{"name":88,"@type":89},"Aria","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 the main container types covered and how do they differ?","Question",{"text":109,"@type":110},"The guide covers ordered sequences like lists/tuples/strings, sets with unique keys, and dictionaries for key-value associations. It also contrasts membership and key-based operations for dict/set.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How does indexing and slicing work, including negative indexes?",{"text":114,"@type":110},"It uses positive indexes starting at 0 and negative indexes from -1 at the end. Slices use [start:end:step], and missing bounds indicate from the start or up to the end.",{"name":116,"@type":107,"acceptedAnswer":117},"Which list operations are used to modify data in place?",{"text":118,"@type":110},"It explains append, extend, insert, remove, pop, sort, and reverse. These operations can add, delete, reorder, or retrieve list elements while updating the original list.","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},571393,1792033099,{"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},2336464648322,"https://ap-avatar.wpscdn.com/avatar/2200025388227c56fec?_k=1778556882303663488","Container Types   \n◾ ordered sequence, fast index access, repeatable values  \nlist [1,5,9] [\"x\",11,8 .9] [\"word\"] [] tuple (1,5,9) 11,\"y\",7 .4 (\"word\",) ()   \nbool True False  10-6  immutable expression with just comas   \n str as an ordered sequence of chars  \nstr \"One  \\n  Two\" 'I \\'m'  ◾ no a priori order, unique key, fast key access ; keys = base types or tuples  \nnew line  ' escaped  dict {\"key\":\"value\"} {}   \nimmutable, multiline \"1\"Xt2\\\\tYt3  kedy/ictionaryvalue associa1ons:\"one\",3:\"three\",2:\"two\",3.14:\"π \" } ordered sequence of chars tab char  set {\"key1\",\"key2\"} {1,9,3,0} set()   \n\n| for variables, functions, Identifiers\u003Cbr>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~~\u003Cbr>\u003Cbr>| \u003Cbr>type (expression) Conversions\u003Cbr>int (\"15\") can specify integer number base in 2nd parameter\u003Cbr>int (15.56) truncate decimal part (round (15.56) for rounded integer)\u003Cbr>float ( \"-11.24e8\")\u003Cbr>str (78.3) and for litteral representation repr ( \"Text\" ) see other side for string formating allowing finer control\u003Cbr>bool  use comparators (with ==, !=, \u003C, >,…), logical boolean result\u003Cbr>list (\"abc\")  use each element ~~ ~~ ['a','b','c']\u003Cbr>from sequence\u003Cbr>dict ([(3,\"three\"),(1,\"one\")] )  {1:'one',3:'three'} set ([\"one\",\"two\"] )~~ furseoemac~~h~~se~~q~~eu~~l~~emenceen~~t~~  ~~ {'one','two'}\u003Cbr>  \":\" . join (['toto','12','pswd'] ) 'toto:12:pswd'\u003Cbr>joining string sequence of strings\u003Cbr>\"words with spaces\" .split () ['words','with','spaces']\u003Cbr>\"1,4,8,2\" .split (\",\") ['1','4','8','2']\u003Cbr>splitting string\u003Cbr>|\n| --- | --- |\n\nfor lists, tuples, strings,… Sequences indexing  \nnegative index  -6  -5  -4  -3  -2  -1   \npositive index 0 1 2 3 4 5  \nlst= [11, 67, \"abc\", 3.14, 42, 1968]  \npositive slice 0 1 2 3 4 5 6  \nnegative slice-6 -5 -4 -3 -2 -1  \nlst [ :-1]→ [11,67,\"abc\",3 .14,42] lst [1 :-1]→ [67,\"abc\",3 .14,42] lst [ ::2]→ [11,\"abc\",42] lst [ : ]→ [11,67,\"abc\",3 .14,42,1968]  \nlen (lst) 6 individual access to items via [index]  \nlst [1]→ 67 lst [0]→ 11 first one  \nlst [-2]→ 42 lst [-1]→ 1968 last one  \naccess to sub-sequences via [start slice:end slice:step] lst [1 :3]→ [67,\"abc\"] lst [-3:-1]→ [3 .14,42] lst [ :3]→ [11,67,\"abc\"]  \nlst [4 : ]→ [42,1968]  \nMissing slice indication → from start / up to end.  \n On mutable sequences, usable to remove del lst [3:5] and to modify with assignment lst [1 :4]=['hop',9]   \n| | parent statement : |  |  |  |  | |\n| --- | --- | --- | --- | --- | --- | --- |\n|  | indentation ! | statements block 1  \u003Cbr>⁝ parent statement : |  |  |  |  |\n|  |  | | statements block 2  ⁝ |  |  |  |\n|  |  |  |  |  |  |  |\n|  | next statement after block 1 |  |  |  |  |  |\n| |  |  |  |  |  |  |\n\n\n| ☝ floating point numbers…approximated values! angles in radians Maths |  |\n| --- | --- |\n| Operators: + - * / // % **× ÷   ab integer ÷ ÷ remainder\u003Cbr>(1+5.3)*2→ 12.6 abs (-3.2)→3.2 round (3.57 , 1)→3.6 | from math import sin ,pi… sin (pi/4)→0.707… cos (2*pi/3)→-0.4999… acos (0.5)→1.0471… sqrt (81)→9.0 √ log (e **2)→2.0 etc. (cf doc) |\n\nstatements block executed Conditional Statement only if a condition is true  \nif logical expression :  \n| statements block executed as long Conditional loop statement as condition is true\u003Cbr>statements block executed for each Iterative loop statement item of a container or iterator\u003Cbr>while logical expression :  for variable in sequence :\u003Cbr>s = 0   statements block  Loop control   statements block \u003Cbr>i = 1  initializations before the loop  break immediate exit  Go over sequence's values \u003Cbr>condition with at least one variable value (here i)  continue  s = \"Some text\"  initializations before the loop\u003Cbr>  cnt = 0\u003Cbr>while i \u003C= 100 :  ~~n~~ext ~~ ~~iteration  loop variable, value managed by for statement\u003Cbr>\\# statement executed as long as i ≤ 100 i = 100  for c in s :\u003Cbr>si  si  i1* *☝2make condition variable changes=  i2  if cc==nt \"cn:t + 1 Ceun","cbCaipPXWVkNm3GT","https://ap.wps.com/l/cbCaipPXWVkNm3GT","pdf",137039,"English","# Container Types\n## Types and literals\n## Variables, naming rules, and keywords\n## Type conversions and operators\n## Indexing and slicing\n## Conditional statements and loops\n## Display and input\n## Container operations and list methods","[{\"question\":\"What are the main container types covered and how do they differ?\",\"answer\":\"The guide covers ordered sequences like lists/tuples/strings, sets with unique keys, and dictionaries for key-value associations. It also contrasts membership and key-based operations for dict/set.\"},{\"question\":\"How does indexing and slicing work, including negative indexes?\",\"answer\":\"It uses positive indexes starting at 0 and negative indexes from -1 at the end. Slices use [start:end:step], and missing bounds indicate from the start or up to the end.\"},{\"question\":\"Which list operations are used to modify data in place?\",\"answer\":\"It explains append, extend, insert, remove, pop, sort, and reverse. These operations can add, delete, reorder, or retrieve list elements while updating the original list.\"}]","Container Types - Python3 Guide | PDF",1791914956]