SShortSingh.
Back to feed

Python Basics: Variables, Data Types, and Input/Output Explained

0
·13 views

The article introduces Python as a powerful tool for automation, predictive analytics, and machine learning, especially for handling large modern datasets. It explains variables as named storage for data and notes that Python uses dynamic typing, so it infers each value's type automatically. Core data types are covered, including strings, integers, floats, and booleans, each with a short example. The piece also describes how programs communicate using print() for output, with f-strings for mixing text and variables, and input() for collecting user responses.

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 ·

Software developers moving to Canada should check work-permit status before starting

A job offer alone does not establish permission to work in Canada, so developers relocating for a role should verify their immigration status alongside their move plans. The guidance advises identifying the employer, duties, work location, and start date, then checking which work-permit route applies, including whether an LMIA or exemption is relevant. It recommends keeping immigration and employment records in a dated, private, access-controlled folder and avoiding public posting of personal identifiers. It also notes that changes in employer, duties, or location may alter permit conditions, and that a submitted application does not automatically authorize work. The article stresses it is general information rather than legal advice and points readers to current IRCC guidance.

0
ProgrammingDEV Community ·

Python Generator and Docker Automate Weekly Posts Across Medium, Substack, and Bluesky

A developer built a small Python command-line tool that reads a metadata.json file and renders Jinja2 templates into ready-to-publish Markdown and JSON files for Medium, Substack, and Bluesky. Before this, the same weekly changelog had to be reformatted by hand for each platform, which took about 30 minutes per sprint and led to inconsistent wording and missed documentation updates. Earlier attempts using a bash script and a Node.js script failed because of hard-coded file paths and malformed JSON output. The final tool is packaged in a Docker image so the CI pipeline can run it automatically on every sprint. The generator also updates status flags in the metadata file after each successful render.

0
ProgrammingDEV Community ·

Four Python Scripts Helped Turn One Stock Batch Into 39 Products

After a batch of 42 images was rejected over a mis-ordered CSV header, the author began automating their packaging workflow. The first script generates platform-specific metadata headers, since stock sites like Adobe Stock, Vecteezy, and Dreamstime reject uploads with incorrect columns instantly. A companion upload tracker prevents accidental duplicate postings after a re-run. Further scripts convert Markdown documents into styled PDFs and bundle finished products with cover and thumbnail images. The whole kit runs on a modest 1 vCPU, 2 GB server with minimal dependencies, producing 39 products totaling 856 MB.

0
ProgrammingDEV Community ·

How an Upload Tracker and Platform-Specific CSVs Protected a Stock Portfolio

A stock asset creator nearly lost a week of work after pasting the wrong platform's CSV header into an Adobe Stock upload, which caused the entire batch to be rejected. Each stock platform requires a fixed metadata format, with mismatched headers failing before review and malformed content getting rejected later. To solve this, the creator wrote a script that generates a CSV with only the exact columns each platform demands, avoiding extra fields that trigger instant rejections. A companion plain-text ledger tracks which assets have been posted, so reruns after interrupted uploads cannot create duplicate submissions that could lead to account flags.