[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-417795-105":59,"doc-detail-417795-en":135,"doc-similar-417795":161},{"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":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":128,"head_meta":130,"extra_data":132,"updated_unix":134},105,"en","python-cheatsheet-python-quick-reference-command-line-syntax-data-types-strings-numbers-and-control-flow","python-cheatsheet - Python Quick Reference - Command Line, Syntax, Data Types, Strings, Numbers, and Control Flow","","Real Python Pocket Reference provides fast, practice-oriented Python guidance covering core workflow and essential language syntax. It starts with getting started steps, using the interactive shell, running scripts, and finding more material on Real Python. It then summarizes key concepts including comments, data types and type checking, variables and assignment styles, string creation and operations, basic number and math operators, conditional statements, and loop patterns with control flow.",{"@graph":69,"@context":127},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/python-cheatsheet-python-quick-reference-command-line-syntax-data-types-strings-numbers-and-control-flow/417795/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/python-cheatsheet-python-quick-reference-command-line-syntax-data-types-strings-numbers-and-control-flow/417795.png","ImageObject",300,407,{"name":92,"@type":93},"Levi","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-30","2026-09-28",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",21,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119,123],{"name":110,"@type":111,"acceptedAnswer":112},"How do you start and exit Python’s interactive shell?","Question",{"text":113,"@type":114},"Start it with python. Exit using exit() from the interactive session.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"What is the recommended convention for variable assignment in Python?",{"text":118,"@type":114},"Create variables when first assigned, use descriptive variable names, and follow snake_case convention.",{"name":120,"@type":111,"acceptedAnswer":121},"How does Python handle string formatting and slicing?",{"text":122,"@type":114},"Use f-strings or format() for interpolation. For slicing, apply bracket notation like text[1:4] or text[:3], including reverse slices such as text[::-1].",{"name":124,"@type":111,"acceptedAnswer":125},"What basic control structures does this reference cover for flow control?",{"text":126,"@type":114},"It covers if/elif/else conditionals using indentation, and loops using for and while, including break/continue-style control.","https://schema.org",{"og:url":83,"og:type":129,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":131,"canonical":83},"index,follow",{"doc_id":133,"site_id":62},417795,1791047047,{"code":4,"msg":5,"data":136},{"doc_id":133,"user_id":137,"nickname":92,"user_avatar":138,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":139,"file_id":140,"file_url":141,"file_type":142,"file_size":143,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":81,"language":144,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":67,"update_tm":148,"read_time":39,"preview_page_count":81,"preview_urls":149},7971461740909,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Real Python Pocket Reference  \nVisit real python.com to turbocharge your Python learning within-depth tutorials, real-world examples, and expert guidance.  \nGetting Started  \nFollow these guides to kickstart your Python journey:  \n [realpython.com/what-can-i-do-with-python](realpython.com/what-can-i-do-with-python)  \n [realpython.com/installing-python](realpython.com/installing-python)  \n [realpython.com/python-first-steps](realpython.com/python-first-steps)  \nStart the Interactive Shell  \n$ python  \nQuit the Interactive Shell  \n>>> exit()  \nRun a Script  \n$ python my_script .py  \nRun a Script in Interactive Mode  \n$ python -i my_script .py  \nLearn More on [realpython.com/search:](realpython.com/search:)  \n interpreter  ∙ run a script  ∙  command line   \nComments  \n Always add a space after the \\#  \n Use comments to explain “why” of your code  \nWrite Comments  \n\\# This is a comment  \n\\# print( \"This code will not run . \" )  \nprint( \"This will run . \" ) \\# Comments are ignored by Python  \nLearn More on [realpython.com/search:](realpython.com/search:)  \n comment  ∙ documentation   \nData Types  \n Python is dynamically typed  \n Use None to represent missing or optional values  \n Use type() to check object type  \n Check for a specific type with isinstance()  \n issubclass () checks if a class is a subclass  \nType Investigation  \ntype(42)  \ntype(3 .14)  \ntype( \"Hello \" )  \ntype(True)  \ntype(None)  \n\\# \u003Cclass ' int ' >  \n\\# \u003Cclass 'float ' >  \n\\# \u003Cclass 'str ' >  \n\\# \u003Cclass 'bool ' >  \n\\# \u003Cclass 'NoneType ' >  \nisinstance(3 .14 , float) \\# True  \nissubclass (int , object) \\# True - everything inherits from object  \nType Conversion  \nint( \"42 \" ) float( \"3 .14 \" ) str(42) bool (1 ) list( \"abc \" )  \n\\# 42 \\# 3 .14 \\# \"42 \"  \n\\# True  \n\\# [ \"a \" , \"b \" , \"c \" ]  \nLearn More on [realpython.com/search:](realpython.com/search:)  \n data types  ∙ type checking  ∙  isinstance  ∙  issubclass   \nVariables & Assignment  \n Variables are created when first assigned  \n Use descriptive variable names  \n Follow snake_case convention  \nBasic Assignment  \nname = \" Leo \"age = 7  \nheight = 5 .6 is_cat = True flaws = None  \n\\# String  \n\\# Integer  \n\\# Float  \n\\# Boolean  \n\\# None type  \nParallel & Chained Assignments  \nx , y = 10 , 20 \\# Assign multiple values  \na = b = c = 0 \\# Give same value to multiple variables  \nAugmented Assignments  \ncounter += 1  \nnumbers += [4 , 5 ] permissions |= write  \nLearn More on [realpython.com/search:](realpython.com/search:)  \n variables  ∙ assignment operator  ∙  walrus operator   \nStrings  \n It’s recommended to use double-quotes for strings  \n Use \" \\n \" to create a line break in a string  \n To write a backslash in a normal string, write \" \\\\ \"  \nCreating Strings  \nsingle = 'Hello 'double = \"World \"multi = \"\"\"Multiple line string \"\"\"  \nString Operations  \ngreeting = \"me \" + \"ow! \" \\# \"meow! \"  \nrepeat = \"Meow! \" * 3 \\# \"Meow!Meow!Meow! \"  \nlength = len ( \" Python \" ) \\# 6  \nString Methods  \n\"a \" .upper()  \n\"A \" .lower ()  \n\" a \" .strip()  \n\"abc \" . replace ( \"bc \" , \"ha \" )\"a b \" .split()  \n\" - \" .join([ \"a \" , \"b \" ])  \n\\# \"A \"  \n\\# \"a \"  \n\\# \"a \"  \n\\# \"aha \"  \n\\# [ \"a \" , \"b \" ]  \n\\# \"a-b \"  \nString Indexing & Slicing  \ntext = \" Python \"  \ntext [0 ] \\# \" P \" (first)  \ntext [-1 ] \\# \"n \" (last)  \ntext [1 :4 ] \\# \"yth \" (slice) text [ :3 ] \\# \" Pyt \" (from start) text [3 : ] \\# \"hon \" (to end) text [ : :2 ] \\# \" Pto \" (every 2nd) text [ : :-1 ] \\# \"nohtyP \" ( reverse)  \nString Formatting  \n\\# f-strings  \nname = \"Aubrey \"age = 2  \nf\"Hello , {name} ! \" \\# \"Hello , Aubrey! \"  \nf\"{name} is {age} years old \" \\# \"Aubrey is 2 years old \"  \nf\"Debug : {age= } \" \\# \"Debug : age=2 \"  \n\\# Format method  \ntemplate = \"Hello , {name} ! You ' re {age} . \"  \ntemplate .format(name= \"Aubrey \" , age=2 ) \\# \"Hello , Aubrey! You ' re 2 . \"  \nRaw Strings  \n\\# Normal string with an escaped tab  \n\"This is :\\tCool . \" \\# \"This is : Cool . \"  \n\\# Raw string with escape sequences  \nr \"This is :\\tCool . \" \\# \"This is :\\tCool . \"  \nLearn More on [r","cbCaikV5KgdjwUf5","https://ap.wps.com/l/cbCaikV5KgdjwUf5","pdf",339997,"English","# Getting Started\n## Start the Interactive Shell\n## Run a Script\n## Run a Script in Interactive Mode\n# Comments\n# Data Types\n## Type Investigation\n## Type Conversion\n# Variables & Assignment\n## Basic Assignment\n## Parallel & Chained Assignments\n## Augmented Assignments\n# Strings\n## Creating Strings\n## String Operations\n## String Methods\n## String Indexing & Slicing\n## String Formatting\n## Raw Strings\n# Numbers & Math\n## Arithmetic Operators\n## Useful Functions\n# Conditionals\n## If-Elif-Else\n## Comparison Operators\n## Logical Operators\n# Loops\n## For Loops\n## While Loops\n## Loop Control","[{\"question\":\"How do you start and exit Python’s interactive shell?\",\"answer\":\"Start it with python. Exit using exit() from the interactive session.\"},{\"question\":\"What is the recommended convention for variable assignment in Python?\",\"answer\":\"Create variables when first assigned, use descriptive variable names, and follow snake_case convention.\"},{\"question\":\"How does Python handle string formatting and slicing?\",\"answer\":\"Use f-strings or format() for interpolation. For slicing, apply bracket notation like text[1:4] or text[:3], including reverse slices such as text[::-1].\"},{\"question\":\"What basic control structures does this reference cover for flow control?\",\"answer\":\"It covers if/elif/else conditionals using indentation, and loops using for and while, including break/continue-style control. \"}]","python-cheatsheet - Python Quick Reference - Command Line, Syntax, Data Types, Strings, Numbers, and Control Flow | PDF",1790610650,[150,154,157],{"page_no":8,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/03c2546b5766ac47818dcafa17d2f8cd.webp",983,552,{"page_no":14,"url":155,"width":156,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/a52d7533c64c8bd7cc7dec7fe9606ee4.webp",982,{"page_no":81,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/3d80f06b1adebde0d4ebe3d8a4d01fac.webp",981,551,{"list":162,"token":66},[163,169,176,182,189,196,202,208,214,220],{"doc_id":164,"doc_title":165,"file_type":142,"home_preview_img_url":166,"slug":167,"view_count":19,"category_name":30,"create_tm":168},689117,"Basic Python Syntax","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001514097/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=AiRRWVSj0ocsv3RAyjBBJEb7zKU%3D","basic-python-syntax",1794096795,{"doc_id":170,"doc_title":171,"file_type":142,"home_preview_img_url":172,"slug":173,"view_count":174,"category_name":30,"create_tm":175},19157,"C++ & Python for Beginners","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229709434556/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=84ol1pVG1Ewp2Zibj2bF1ECJwks%3D","c-python-for-beginners",65,1777154415,{"doc_id":177,"doc_title":178,"file_type":142,"home_preview_img_url":179,"slug":180,"view_count":19,"category_name":30,"create_tm":181},719777,"Python For Dummies - Introducing Python - Getting Started","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023659675/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=vuNDJKH71CFAEzckctsfvm%2F92ek%3D","python-for-dummies-introducing-python-getting-started",1795031061,{"doc_id":183,"doc_title":184,"file_type":142,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":30,"create_tm":188},417792,"Python glossary of terms","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229922495520/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=ylJBgbgNeU8S%2FspHUC%2FK37bTAVQ%3D","python-glossary-of-terms",15,1790610644,{"doc_id":190,"doc_title":191,"file_type":142,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":30,"create_tm":195},689083,"Scripting in Mechanical Guide - Release 2026 R1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000678733/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=XGLHJTHFO8gop7Jk3del6cndcu0%3D","scripting-in-mechanical-guide-release-2026-r1",11,1794095514,{"doc_id":197,"doc_title":198,"file_type":142,"home_preview_img_url":199,"slug":200,"view_count":52,"category_name":30,"create_tm":201},646216,"MySQL - Table of Contents - SQL keyword reference and chapter guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229971804144/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=WDYnXtQypHDldvjzbKASw5ENxZ0%3D","mysql-table-of-contents-sql-keyword-reference-and-chapter-guide",1792753725,{"doc_id":203,"doc_title":204,"file_type":142,"home_preview_img_url":205,"slug":206,"view_count":44,"category_name":30,"create_tm":207},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=1796111939&Signature=lBWOcHuzCOp%2Ft9uEHZL33GlKQQM%3D","python-quick-guide-beginner-start-here",1794186385,{"doc_id":209,"doc_title":210,"file_type":142,"home_preview_img_url":211,"slug":212,"view_count":24,"category_name":30,"create_tm":213},692351,"Getting Started with Unity Playground","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003283460/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=eF6JNQEdnBl6Z8pgPOc3JwpHwi0%3D","getting-started-with-unity-playground",1794195621,{"doc_id":215,"doc_title":216,"file_type":142,"home_preview_img_url":217,"slug":218,"view_count":24,"category_name":30,"create_tm":219},670915,"Python Cheat Sheet - Quick Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988353347/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=QxojVeeNeEz%2FFntOTycjJL%2Bmjj0%3D","python-cheat-sheet-quick-reference-670915",1793572692,{"doc_id":221,"doc_title":222,"file_type":142,"home_preview_img_url":223,"slug":224,"view_count":225,"category_name":30,"create_tm":226},1651,"PHP Notes for Professionals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229695272201/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=F9%2FTFppnWgAlIkM9gqQ8oEw%2B%2FEc%3D","php-notes-for-professionals",56,1776248257]