[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571753-105":53,"doc-detail-571753-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-tutorial-getting-started-primitives-collections","Python Tutorial - Getting Started - Primitives & Collections","","Python Tutorial & Cheat Sheet provides a quick, practical introduction to getting started with Python and running scripts from a command-line style interpreter. It explains core Python primitives including numbers, strings, and booleans, showing how to check types and perform common string operations such as upper, replace, and count. It then covers key collections: lists with indexing and size/manipulation via len, append, and pop, plus dictionaries using key-value lookup and methods like keys() and values().",{"@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":51,"@type":70,"position":76},"https://docshare.wps.com/template/general/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/python-tutorial-getting-started-primitives-collections/571753/",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-tutorial-getting-started-primitives-collections/571753.png","ImageObject",442,249,{"name":88,"@type":89},"Mabel","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},"How do you run a Python script from the command line?","Question",{"text":109,"@type":110},"Use the syntax $python filename.py to execute the script with the Python interpreter.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What are Python primitives covered in this tutorial?",{"text":114,"@type":110},"It covers numbers (integers and floats), strings (including basic operations), and booleans (True/False comparisons).",{"name":116,"@type":107,"acceptedAnswer":117},"How do lists and dictionaries work in the tutorial?",{"text":118,"@type":110},"Lists store values in order and support indexing starting at 0 plus operations like len, append, and pop. Dictionaries store key-value pairs for lookup and provide keys() and values() to list contents.","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},571753,1792086595,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":50,"category_name":51,"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":40,"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":141},7971474920318,"https://ap-avatar.wpscdn.com/avatar/74000ee537e6b0ca360?x-image-process=image/resize,m_fixed,w_180,h_180&k=1788430171632181674","Python Tutorial  \n& Cheat Sheet  \nGetting Started  \nWhat you need:  \n􀂃 Linux based machine with Python 2.7 or higher (comes default on most linux systems)(Python on windows also works though not ideal)  \n􀂃 Editor on Linux such as VI or EMACS to edit your files  \n􀂃 Python interpreter: operates similar to a unix shell: reads and executes commands interactively  \n􀂃 Setting your path variable to include the location of the Python interpreter: (usually /usr/local/bin/python  \n􀂃 Run python scripts by using the following syntax: $python filename.py  \nPython Basics  \n1. Primitives  \nNumbers  \nPython has integers and floats. Integers are whole numbers, like 314, 500. Floats, meanwhile, are fractional numbers like 3.14, 2.867, 76.88887  \nYou can use the type method to check the value of an object.  \n>>> type(3)  \n\u003Ctype 'int'>  \n>>> type(3.14)  \n\u003Ctype 'float'>  \n>>> pi = 3.14  \n>>> type(pi)  \n\u003Ctype 'float'>  \nStrings  \nStrings are. used quite often in Python. Strings, are just that, a string of characters. A character is anything you can type on the keyboard in one keystroke, like a letter, a number, or a backslash. Python recognizes single and double quotes as the same thing, the beginning and ends of the strings.  \n>>> “string list”  \n‘string list’  \n>>> ‘string list’  \nyou can also join strings with use of variables as well.  \n>>> a = “first”  \n>>> b = “last”  \n>>> a + b  \n‘firstlast’  \nMethods:  \nThere are also different string methods for you to choose from as well – like upper , lower , replace ,  \nand count.  \nUpper:  \n>>> w=‘hello!‘  \n>>> w.upper()‘HELLO!‘  \nReplace:  \n>>>r= 'rule‘  \n>>>r.replace('r','m')'mule‘  \nLower:  \n>>> w=‘HELLO!‘  \n>>> w.upper()‘hello!‘  \nCount:  \n>>>numbers=['1','2','1','2','2']>>>numbers.count('2')  \n3  \nBooleans  \nBoolean values are simply True or False .  \nValue is equal to another value with two equal signs: To check for inequality use:  \n>>> 10 == 10 >>> 10 != 10  \nTrue False  \n>>> 10 == 11 >>> 10 != 11  \nFalse True  \n>>> \"jack\" == \"jack“ >>> \"jack\" != \"jack\"  \nTrue False  \n>>> \"jack\" == \"jake“ >>> \"jack\" != \"jake\"  \nFalse True  \n2. Collections  \nLists:  \nLists are containers for holding values.  \n>>> fruits = ['apple','lemon','orange','grape']  \n>>> fruits  \n['apple', 'lemon', 'orange', 'grape']  \nTo access the elements in the list you can use the placement in the list as an indicator. This means numbering the items aligned with their placement in the list. The list starts with 0  \n‘o>>> fruits[2]  \nrange’  \nLen, Append and Pop  \nUse len to find number of elements in the list. Use append to add a new object to the end of the list and pop to  \nremove objects from the end.  \n>>> fruits.append('blueberry')  \n>>> fruits  \n['apple', 'lemon', 'orange', 'grape', 'blueberry']  \n>>> fruits.append('tomato')  \n>>> fruits  \n['apple', 'lemon', 'orange', 'grape', 'blueberry', 'tomato']  \n>>> fruits.pop()  \n'tomato'  \n>>> fruits  \n['apple', 'lemon', 'orange', 'grape', 'blueberry']  \nDictionaries  \nA dictionary optimizes element lookups. It uses keys and values, instead of numbers as placeholders. Each key must have a value. You can used a word to look up a value.  \n>>> words={'apple':'red','lemon':'yellow'}  \n>>> words  \n{'lemon': 'yellow', 'apple': 'red'}  \n>>> words['apple']  \n'red'  \n>>> words['lemon']  \n'yellow‘  \nOutput all the keys as a list with keys() and all the values with values()  \n>>> words.keys()  \n['lemon', 'apple']  \n>>> words.values()  \n['yellow', 'red']","cbCaieYBQowJqyNF","https://ap.wps.com/l/cbCaieYBQowJqyNF","pdf",588090,"English","# Getting Started\n## What you need\n## Python Basics\n### Primitives\n### Collections","[{\"question\":\"How do you run a Python script from the command line?\",\"answer\":\"Use the syntax $python filename.py to execute the script with the Python interpreter.\"},{\"question\":\"What are Python primitives covered in this tutorial?\",\"answer\":\"It covers numbers (integers and floats), strings (including basic operations), and booleans (True/False comparisons).\"},{\"question\":\"How do lists and dictionaries work in the tutorial?\",\"answer\":\"Lists store values in order and support indexing starting at 0 plus operations like len, append, and pop. Dictionaries store key-value pairs for lookup and provide keys() and values() to list contents.\"}]","Python Tutorial - Getting Started - Primitives & Collections | PDF",1791923585,6]