SShortSingh.
Back to feed

Python Data Structures cheat sheets: when to use lists, sets, tuples and dictionaries.

0
·1 views

A data structure is a way of organising information and the choice depends on use. The best data structure to use depends on how you intend to access and manipulate the data, as each structure has advantages and disadvantages for different operations. Essential Python Data Structures. 1.Lists. How to create a list; creating a list puts items into square brackets[], separated by commas and the items can be a string, numbers or booleans.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Comparing Prometheus Pull and Push API Custom Metrics for Small SaaS Node.js

Short answer: start with a push-style metrics API when a small Node.js team needs to judge a flagged property-pricing rule from a few application-level signals. Choose Prometheus plus Grafana when scrape-based infrastructure coverage, Kubernetes integrations, or sophisticated querying matter more than setup weight. The deciding variable is signal quality versus noise, not dashboard polish. For a solo founder, Infrai's native surface also exposes consistent per-call cost, vendor, and latency metadata. Those fields make the monitoring path's own overhead visible while the pricing experiment runs

0
ProgrammingDEV Community ·

Parse a TikTok Profile URL Without Keeping Tracking Parameters

People paste profile links from chats, browsers, and share sheets. Those links can carry query parameters that are irrelevant to identifying the account. A small parser should extract a handle from the profile path, reject unrelated hosts, and leave the original URL out of the lookup key. I built TikStories to accept a public TikTok handle or profile URL and show currently active public Stories. The example below is a standalone parsing exercise, not a copy of the site's internal code.

Python Data Structures cheat sheets: when to use lists, sets, tuples and dictionaries. · ShortSingh