Category

Programming Tutorials and Coding Guides

Explore programming tutorials with practical examples across multiple languages, scripting, and development concepts for beginners and advanced users.

Welcome to the Programming tutorials section, where you will learn coding concepts with real-world examples across multiple languages and platforms.

This category includes beginner to advanced guides covering scripting, automation, and application development in Java, JavaScript, Python, Go, TypeScript, and related stacks.

Whether you are learning programming for system administration or building applications, browse the articles below for practical examples and language-specific references.

Programming plays a crucial role in modern infrastructure and DevOps workflows. You can also explore DevOps and Linux to see how code integrates with system-level operations.

956 articles

Programming category illustration with code editor, automation, and debugging graphics
programming

Python Call Function from Another File

Learn how to call a function from another Python file using import, from import, package imports from a different directory, importlib, and fixes for ModuleNotFoundError.

Deepak Prasad5 min read
programming

Python Multithreading Examples: Thread, Lock, Queue, and ThreadPoolExecutor

Learn Python multithreading with practical examples using threading.Thread, start(), join(), daemon threads, Lock, Queue, ThreadPoolExecutor, and best practices for I/O-bound tasks.

Deepak Prasad7 min read
programming

Python Catch Multiple Exceptions

Learn how to catch multiple exceptions in Python using one except block with a tuple, separate except blocks, as e, else, finally, and best practices for handling multiple errors.

Bashir Alam5 min read
programming

List Comprehension in Python with Examples

Learn Python list comprehension: syntax, filters, if-else, range and strings, nested and multiple for loops, flattening lists of lists, map and filter alternatives, pitfalls, and a quick reference table.

Bashir Alam10 min read
programming

Python Multiprocessing Example: Process, Pool, and Queue

Learn Python multiprocessing with practical examples using Process, Pool, pool.map(), Queue, join(), CPU-bound tasks, shared data, and common multiprocessing mistakes.

Deepak Prasad9 min read
programming

Go Channels Tutorial: Send, Receive, Close, Range, and Select

Learn channels in Go, including send and receive syntax, buffered and unbuffered channels, close, range, select, deadlocks, and common concurrency patterns.

Antony Shikubu9 min read
programming

Golang exec Command: Run Shell Commands, Capture Output, and Handle Errors

Learn how to run external commands in Go using os/exec, capture stdout and stderr, pass arguments, use shell commands, set timeouts, and avoid command injection.

Deepak Prasad14 min read
programming

Python map() Function with Examples

Learn Python map() function with examples using custom functions, lambda, built-in functions, multiple iterables, string conversion, list conversion, and map vs list comprehension.

Bashir Alam6 min read
programming

Loop Through Two Lists in Python

Learn how to loop through two or more lists in Python using zip(), enumerate(), range(), indexes, nested loops, and zip_longest() for lists with different lengths.

Deepak Prasad8 min read
programming

Python Loop N Times: Repeat Code Using range()

Learn how to loop N times in Python using for range(), repeat code 5 or 10 times, loop without an index, use while loops, and avoid common off-by-one mistakes.

Deepak Prasad5 min read
programming

Python List pop() Method: Remove and Return Items

Learn how Python list pop() removes and returns items by index, defaults to the last item, handles pop(0), raises IndexError, and compares with remove(), del, and clear().

Bashir Alam9 min read
programming

Get File Extension in Python: pathlib, os.path, and edge cases

Learn how to get a file extension in Python using pathlib (suffix, suffixes), os.path.splitext, case-insensitive checks, multi-part names like .tar.gz, and common pitfalls.

Bashir Alam4 min read
programming

Install a Python Package from GitHub with pip: branches, tags, SSH, and requirements.txt

Install Python packages from GitHub using pip: PEP 508 git URLs, branches, tags, commits, editable installs, requirements.txt, private repos over HTTPS or SSH, subdirectory packages, verification, upgrades, and common …

Azka Iftikhar8 min read
programming

Python List with Examples

Learn Python lists with simple examples to create a list, access items, change values, add and remove elements, loop through lists, sort, copy, and use common list methods.

Deepak Prasad8 min read
programming

Python Line Continuation: Continue Code on the Next Line

Learn how Python line continuation works using parentheses, brackets, braces, and backslash, with examples for long expressions, strings, lists, function calls, and common errors.

Bashir Alam7 min read
programming

FAISS Python API Tutorial: IndexFlatL2, IndexIVFFlat, add, search, and remove_ids

Practical FAISS Python API guide: install faiss-cpu, NumPy float32 shapes, IndexFlatL2 and IndexFlatIP, add and search, IndexIVFFlat training and nprobe, IndexIDMap and remove_ids, save/load indexes, common dtype and …

Deepak Prasad8 min read
programming

Python Measure Execution Time: time, perf_counter, and timeit

Learn how to measure execution time in Python using time.perf_counter(), timeit, process_time(), and decorators, with examples in seconds, milliseconds, and nanoseconds.

Azka Iftikhar6 min read
programming

Golang Struct Embedding: Composition, Promoted Fields, and Methods

Golang struct embedding and go struct embedding: anonymous embedded fields, promoted fields and methods per the Go spec, composition vs inheritance, pointer embedding, name conflicts, interface embedding, satisfying …

Tuan Nguyen8 min read
programming

Python Marshmallow Tutorial: Schema, Fields, dump(), and load()

Learn Python Marshmallow with examples for creating schemas, using fields, serializing data with dump(), deserializing and validating data with load(), nested schemas, many=True, DateTime formatting, and common errors.

Bashir Alam8 min read
programming

Golang Pointers Tutorial: Address, Dereference, nil, and Pointer Receivers

Learn pointers in Go: pointer types *T, address operator &, dereferencing, nil pointers, passing pointers to functions, pointer receivers, structs, slices and maps, and when not to use pointers.

Antony Shikubu9 min read
programming

Implement a Binary Search Tree in Python: insert, search, delete, traverse

Build a BST in Python with a Node class, iterative insert and search, inorder preorder postorder traversals, delete for leaf one-child and two-child nodes, duplicate policy, complexity, and common pitfalls.

Deepak Prasad11 min read
programming

Nested Dictionary in Python: Create, Access, Update, and Loop

Learn nested dictionaries in Python with examples to create, access, update, add, delete, loop through, flatten, and merge dictionary inside dictionary data.

Bashir Alam7 min read
programming

Python Lambda & Anonymous Functions: Syntax, Examples, map(), filter(), sorted()

Learn Python lambda functions (anonymous functions): syntax, examples with multiple arguments, map(), filter(), sorted(), conditional expressions, limits, common mistakes, and when to use def instead.

Bashir Alam6 min read
programming

Combine Two Arrays as Columns in NumPy: column_stack, hstack, and concatenate

Combine two lists or 1-D NumPy arrays into a two-column 2-D array using numpy.column_stack, with numpy.stack axis=1, numpy.hstack for column-shaped inputs, numpy.concatenate axis=1, row vs column stacking, shape rules …

Deepak Prasad5 min read
programming

Create Simple & Complex Python Package with Examples

This guide will lead you on how to create a Python package which includes setup, configuration, building and publishing. You will learn how to include more files, test locally and version control for successful …

Deepak Prasad18 min read
programming

Python any() and all() Functions: Check If Any or All Items Are True

Learn how Python any() and all() work with lists, strings, dictionaries, truthy and falsy values, generator expressions, short-circuiting, and common mistakes.

Bashir Alam7 min read
programming

Golang Interface Tutorial: Examples, Implementation, and Type Assertion

Learn interfaces in Go with simple examples, including method sets, implicit implementation, interface parameters, empty interface, any, type assertion, printing interface values, composition, pointer receivers, and …

Antony Shikubu12 min read
programming

pip requirements.txt File: Create, Install, and Use with pip

Learn how to use a pip requirements.txt file to install Python dependencies with pip install -r, create the file manually or with pip freeze, add version constraints, and fix common errors.

Omer Cakmak8 min read
programming

Python Add to Dictionary: Add Key-Value Pairs, Update, and Append

Learn how to add to a dictionary in Python using key assignment, update(), setdefault(), |=, and dictionary unpacking, with examples for single keys, multiple keys, lists, nested dictionaries, and existing keys.

Deepak Prasad5 min read
programming

Merge Dictionaries in Python: |, update(), **, and More

Learn how to merge dictionaries in Python using the | operator, update(), ** unpacking, copy(), ChainMap, and more, with duplicate key behavior and Python version differences.

Deepak Prasad7 min read