Skip to content
Home
Dev Convert Generate Finance Calc Design Security Media

More categories

Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

GuidesBlogAPI & MCPCheatsheetsChangelog All categories

Browse

439 tools · 15 categories

Start here

Popular tools New this week 11 All tools 439

Categories

Developer Tools 91 Converters 65 Calculators 32 Finance Tools 32 Generators 31 Media Tools 27 Design Tools 25 Security Tools 25 Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

Guides Cheatsheets Blog REST API MCP server Changelog

No matches here.

Keep FindUtils free Sponsors fund new tools
  1. Cheatsheets
Guides Blog API & MCP
Sponsor
FindUtils
Sponsor
  1. Home
  2. Cheatsheets
  3. Programming
  4. Python Essentials

Programming · Cheatsheet

Python Essentials Cheatsheet

Python syntax, data structures, comprehensions, built-in functions, and common patterns

59 commands 8 sections

On this sheet

Data Types & Variables 8 Strings 9 Lists 11 Dictionaries 8 Control Flow 8 Functions 7 File I/O & Error Handling 6 Sources 2
Try it in the browser Create Python dataclasses or Pydantic models from JSON data. Open JSON to Python Class

No entry matches that filter.

Data Types & Variables

  • x = 10 Integer
  • x = 3.14 Float
  • x = "hello" String
  • x = True / False Boolean
  • x = None NoneType (null equivalent)
  • type(x) Get type of variable
  • isinstance(x, int) Check if instance of type
  • int() float() str() bool() Type conversion functions

Strings

  • f"Hello {name}" f-string (formatted string literal)
  • s.upper() / s.lower() Convert case
  • s.strip() Remove leading/trailing whitespace
  • s.split(",") / ",".join(lst) Split string / join list
  • s.replace("old", "new") Replace substring
  • s.startswith() / s.endswith() Check prefix/suffix
  • s.find("sub") Find substring index (-1 if not found)
  • s[1:5] Slice string (index 1 to 4)
  • s[::-1] Reverse string

Lists

  • lst = [1, 2, 3] Create list
  • lst.append(4) Add element to end
  • lst.insert(0, "first") Insert at index
  • lst.pop() / lst.pop(0) Remove last / at index
  • lst.remove(val) Remove first occurrence of value
  • lst.sort() / sorted(lst) Sort in-place / return sorted copy
  • lst.reverse() Reverse in-place
  • len(lst) Number of elements
  • val in lst Check if value exists
  • [x*2 for x in lst] List comprehension
  • [x for x in lst if x > 0] Filtered list comprehension

Dictionaries

  • d = {"key": "val"} Create dictionary
  • d["key"] / d.get("key", default) Access value / with default
  • d.keys() / d.values() / d.items() Get keys / values / pairs
  • d.update(other) Merge another dict into d
  • d.pop("key") Remove and return value
  • "key" in d Check if key exists
  • {k: v for k, v in items} Dict comprehension
  • d | other Merge dicts (Python 3.9+)

Control Flow

  • if x > 0: ... elif: ... else: Conditional
  • for item in iterable: For loop
  • for i, val in enumerate(lst): Loop with index
  • for k, v in d.items(): Loop over dict items
  • while condition: While loop
  • break / continue / pass Loop control
  • x if condition else y Ternary expression
  • match value: case pattern: Structural pattern matching (3.10+)

Functions

  • def fn(a, b="default"): Function with default parameter
  • def fn(*args, **kwargs): Variable arguments
  • lambda x: x * 2 Anonymous function
  • map(fn, iterable) Apply function to each element
  • filter(fn, iterable) Filter elements by function
  • @decorator Function decorator syntax
  • def fn() -> int: Type hint for return value

File I/O & Error Handling

  • with open("f.txt") as f: Open file (auto-close)
  • f.read() / f.readlines() Read entire file / as lines
  • f.write("text") Write to file
  • try: ... except Exception as e: Try/except block
  • try: ... finally: Always-run cleanup block
  • raise ValueError("msg") Raise an exception

Sources

  • https://docs.python.org/3/reference/ Python 3 language reference: syntax and execution rules.
  • https://docs.python.org/3/library/ Python 3 standard library: built-in types, functions, and file operations.

Related cheatsheets

  • Barcode Formats40 commands
  • JavaScript ES6+59 commands
  • Regular Expressions44 commands

Tools for this work

  • JSON to Python ClassCreate Python dataclasses or Pydantic models from JSON data.

From FindUtils

More to explore

Products and services from the team behind FindUtils.

Promote your tool
Featured product seeranks.com SeeRanks — transparent product discovery A public ranking board where paid placement is always labeled and every product keeps its earned position. View SeeRanks Public rank board #1 Sponsored #2 #3 #4 Paid placement is always labeled Free favicon tool emojifavicons.com Emoji Favicons Turn any emoji into a favicon with one HTML line. SVG, PNG or ICO, no sign-up. <link rel="icon" href=".../🦊.svg"> Create a favicon
FindUtils service findutils.com Articles for software tools A sourced article for your channels, or a sponsored FindUtils publication with editorial review. Compare packages Domain portfolio findutils.com Domain names for sale .com.dev.sh.app.io Unused names across dev tools, AI, PDF and commerce. Make an offer. Browse the list Playable ranking towerscore.io TowerScore — stack the skyline Play to climb, or buy a floor. Paid floors are labeled. Open TowerScore

Missing a tool you need?

Tell us what to build next. Most requests ship as a free browser tool, an API endpoint and an MCP tool.

Request a tool
FindUtils

Free, fast utilities. Most tools process your files in the browser; lookup tools say what they send, and pages load analytics and ads.

  • No sign-up for free tools
  • Most tools run in your browser
  • 369 tools on the REST API, 369 on MCP

Tools

DevelopersConvertPDFDesignSecurityAll tools →

Learn

GuidesBlogCheatsheetsChangelog

Build

REST APIMCP serverAPI referenceWorkflowsStatus

FindUtils

AboutLibraries we useSponsorRequest a toolDomains for saleContact
© 2026 FindUtils PrivacyTermsSitemap
Service status
FindUtils

Free, fast utilities that respect your data. Most tools run in your browser.

Build with it

REST APIMCP serverGuidesChangelog

FindUtils

AboutSponsorPrivacyContact
Theme
© 2026 FindUtils Terms
FindUtils
Guides Blog REST API MCP server Changelog

Categories

Developers 91 Convert 65 Calculate 32 Finance 32 Generate 31 Media 27
All 15 categories →

Keep it free

Sponsorship keeps every tool free and funds the new ones we ship each week.

Sponsor Back the project
Tools API Sponsor