[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572242-105":53,"doc-detail-572242-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","beginners-python-cheat-sheet-basic-python-concepts","Beginners Python Cheat Sheet - Basic Python Concepts","","Beginner’s Python cheat sheet covering core language building blocks and practical syntax patterns. Covers variables and strings with f-strings, list operations including indexing, slicing, loops, list comprehensions, and item additions. Explains tuples as immutable sequences. Introduces if statements with comparison and membership tests, boolean assignment, and if-elif-else flows. Covers dictionaries with key-value access and iteration, plus user input handling with type conversion. Includes while loops, functions with arguments and default parameters, return values, and basic class structure with attributes, methods, inheritance, and a child class example.",{"@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/beginners-python-cheat-sheet-basic-python-concepts/572242/",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/beginners-python-cheat-sheet-basic-python-concepts/572242.png","ImageObject",442,249,{"name":88,"@type":89},"Well Done","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 variables and strings in Python, and how do f-strings work?","Question",{"text":109,"@type":110},"Variables label values, while strings are character sequences wrapped in quotes. f-strings embed variables inside a string to build dynamic messages.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How do you work with lists, including indexing, slicing, and list comprehensions?",{"text":114,"@type":110},"Lists store ordered items accessed by index, including negative indices for the last item. Slicing uses start and end positions, and list comprehensions generate new lists from expressions over ranges.",{"name":116,"@type":107,"acceptedAnswer":117},"How do you define functions and classes, and what is inheritance in Python?",{"text":118,"@type":110},"Functions are named blocks with arguments and parameters, can have default parameter values, and may return results. Classes store data in attributes and behavior in methods; a child class inherits from a parent using inheritance and can extend it with additional methods.","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},572242,1792022498,{"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":136,"language":137,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":138,"faqs":139,"seo_title":140,"seo_description":61,"update_tm":141,"read_time":142},5909892210082,"https://ap-avatar.wpscdn.com/avatar/56001069da27c9f41e8?x-image-process=image/resize,m_fixed,w_180,h_180&k=1789614185077863061","Beginner's Python Cheat Sheet  \nVariables and Strings  \nVariables are used to assign labels to values. A string is a series of characters, surrounded by single or double quotes. Python's f-strings allow you to use variables inside strings to build dynamic messages.  \nHello world  \nprint(\"Hello world!\") Hello world with a variable msg = \"Hello world!\"  \nprint(msg)  \nf-strings (using variables in strings) first_name = 'albert'last_name = 'einstein'  \nfull_name = f\"{first_name} {last_name}\"print(full_name)  \nLists  \nA list stores a series of items in a particular order. You access items using an index, or within a loop.  \nMake a list  \nbikes = ['trek', 'redline', 'giant'] Get the first item in a list  \nfirst_bike = bikes[0]  \nGet the last item in a list last_bike = bikes[-1] Looping through a list for bike in bikes:  \nprint(bike) Adding items to a list bikes = []  \nbikes.append('trek')  \nbikes.append('redline')  \nbikes.append('giant') Making numerical lists squares = []  \nfor x in range(1, 11): squares.append(x**2)  \nLists (cont. )  \nList comprehensions  \nsquares = [x**2 for x in range(1, 11)] Slicing a list  \nfinishers = ['sam', 'bob', 'ada', 'bea']  \nfirst_two = finishers[:2] Copying a list copy_of_bikes = bikes[:]  \nTuples  \nTuples are similar to lists, but the items in a tuple can't be modified.  \nMaking a tuple  \ndimensions = (1920, 1080)  \nresolutions = ('720p', '1080p', '4K')  \nIf statements  \nIf statements are used to test for particular conditions and respond appropriately.  \nConditional tests equal x == 42 not equal x != 42  \ngreater than x > 42 or equal to x >= 42  \nless than x \u003C 42 or equal to x \u003C= 42  \nConditional tests with lists'trek' in bikes'surly' not in bikes  \nAssigning boolean values  \ngame_active = True can_edit = False A simple if test if age >= 18:  \nprint(\"You can vote!\") If-elif-else statements if age \u003C 4:  \nticket_price = 0  \nelif age \u003C 18: ticket_price = 10  \nelif age \u003C 65: ticket_price = 40  \nelse:  \nticket_price = 15  \nDictionaries  \nDictionaries store connections between pieces of information. Each item in a dictionary is a key-value pair.  \nA simple dictionary  \nalien = {'color': 'green', 'points': 5} Accessing a value  \nprint(f\"The alien's color is {alien['color']}.\")  \nAdding a new key-value pair alien['x_position'] = 0  \nLooping through all key-value pairs  \nfav_numbers = {'eric': 7, 'ever': 4, 'erin': 47} for name, number in fav_numbers.items():  \nprint(f\"{name} loves {number}.\") Looping through all keys  \nfav_numbers = {'eric': 7, 'ever': 4, 'erin': 47} for name in fav_numbers.keys():  \nprint(f\"{name} loves a number.\") Looping through all the values  \nfav_numbers = {'eric': 7, 'ever': 4, 'erin': 47} for number in fav_numbers.values():  \nprint(f\"{number} is a favorite.\")  \nUser input  \nYour programs can prompt the user for input. All input is stored as a string.  \nPrompting for a value  \nname = input(\"What's your name? \")  \nprint(f\"Hello, {name}!\") Prompting for numerical input age = input(\"How old are you? \")  \nage = int(age)  \npi = input(\"What's the value of pi? \")  \npi = float(pi)  \nPython Crash Course A Hands-on, Project-Based Introduction to Programming  \n[ehmatthes.github.io/pcc_3e](ehmatthes.github.io/pcc_3e)  \nWhile loops  \nA while loop repeats a block of code as long as a certain condition is true. While loops are especially useful when you can't know ahead of time how many times a loop should run.  \nA simple while loop current_value = 1  \nwhile current_value \u003C= 5: print(current_value) current_value += 1  \nLetting the user choose when to quit  \nmsg = ''  \nwhile msg != 'quit':  \nmsg = input(\"What's your message? \")  \nif msg != 'quit':  \nprint(msg)  \nFunctions  \nFunctions are named blocks of code, designed to do one specific job. Information passed to a function is called an argument, and information received by a function is called a parameter.  \nA simple function def greet_user():  \n\"\"\"Display a simple greeting.\"\"\"  \nprint(\"Hello!\")  \ngreet_user()  \nPassing an argument def greet_user(u","cbCaivVx3SRygaQz","https://ap.wps.com/l/cbCaivVx3SRygaQz","pdf",758739,28,"English","# Variables and Strings\n# Lists and Tuples\n# If Statements\n# Dictionaries and User Input\n# While Loops\n# Functions\n# Classes and Inheritance","[{\"question\":\"What are variables and strings in Python, and how do f-strings work?\",\"answer\":\"Variables label values, while strings are character sequences wrapped in quotes. f-strings embed variables inside a string to build dynamic messages.\"},{\"question\":\"How do you work with lists, including indexing, slicing, and list comprehensions?\",\"answer\":\"Lists store ordered items accessed by index, including negative indices for the last item. Slicing uses start and end positions, and list comprehensions generate new lists from expressions over ranges.\"},{\"question\":\"How do you define functions and classes, and what is inheritance in Python?\",\"answer\":\"Functions are named blocks with arguments and parameters, can have default parameter values, and may return results. Classes store data in attributes and behavior in methods; a child class inherits from a parent using inheritance and can extend it with additional methods.\"}]","Beginners Python Cheat Sheet - Basic Python Concepts | PDF",1791926334,10]