Articles by Deepak Prasad
Python casefold() String Method
Learn Python string casefold() with syntax, examples, Unicode case-insensitive comparison, casefold vs lower, and common mistakes when comparing strings.
Python if else Statement: Syntax, elif, Flowchart, and Examples
Learn the Python if, if else, and if elif else statements: syntax, indentation, elif vs else-if, conditions, flow, nested branches, ternary expressions, loop/try else, and common mistakes.
Python Check if File Exists
Learn how to check if a file exists in Python using pathlib Path.exists(), Path.is_file(), os.path.exists(), and os.path.isfile(), with examples for directories, symlinks, and file errors.
Python Return Multiple Values
Learn how to return multiple values from a Python function using comma-separated return values, tuple unpacking, lists, dictionaries, NamedTuple, dataclass, and common mistakes.
Python Tutorial for Beginners (Hands-On)
Free, complete Python tutorial for beginners - variables, strings, lists, dicts, control flow, OOP, file I/O, error handling, regex, concurrency, and Flask, with a full index of every linked hands-on lesson for Python …
Python argparse Example
Learn Python argparse with practical examples for positional arguments, optional flags, default values, type conversion, choices, nargs, boolean flags, and subcommands.
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.
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.
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.
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.
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.
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.
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.
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 …
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.
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 …
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 …
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.
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.
FileNotFoundError in Python: Causes, Fixes, and Path Examples
Learn what FileNotFoundError (No such file or directory, errno 2) means in Python, why it happens even when the file seems to exist, and how to fix it with correct paths, working directory, pathlib, symlinks, and …
Golang Kill Process by PID: Process.Kill, Signal, and CommandContext
Terminate processes from Go by PID or child PID: os.Process and os.FindProcess, Process.Kill vs Process.Signal (SIGTERM vs SIGKILL), stopping commands started with os/exec, timeouts with exec.CommandContext, graceful …
strconv in Go: parse, format, quote, and common errors
strconv in Go: parse and format integers, floats, and bools, Quote and Unquote, bases with FormatUint and ParseInt, NumError with errors.Is, and when to prefer strconv over fmt.Sscanf.
Check if a string contains a substring in Go (strings.Contains)
strings.Contains for literal UTF-8 substrings, case sensitivity and ToLower, match any or all needles, ContainsAny and ContainsRune, Index and HasPrefix or HasSuffix, empty substring behavior, and regexp only when you …
Golang Variable Scope: Local, Package-Level, Global, and Block Scope
Learn variable scope in Go, including local variables, package-level variables, global-style variables, block scope, short declarations, shadowing, and best practices.
Golang Web Server Tutorial: Build and Configure an HTTP Server in Go
Learn how to build a Go web server using net/http, configure routes, handlers, ports, timeouts, static files, JSON responses, and graceful shutdown.
Golang Closure Function: Closures, Captured Variables, and Performance
Learn closures in Go: function values that capture outer variables, how they differ from anonymous functions, returned functions and state, goroutine loop pitfalls, and golang closure performance and escape analysis.
Golang Buffered Channel: Capacity, Blocking, and Buffered vs Unbuffered
Learn buffered channels in Go: make(chan T,n) capacity, len and cap, when send and receive block, buffered vs unbuffered channels, backpressure, deadlocks, choosing buffer size, and practical patterns.
Golang Regexp Tutorial: Match, Find, Replace, and Extract Regex Groups
Learn how to use regex in Go with the regexp package, including MatchString, Compile, MustCompile, FindString, submatches, ReplaceAllString, Split, and common mistakes.
Goroutine vs Thread in Go: Are Goroutines the Same as Threads?
Understand the difference between goroutines and OS threads in Go, how the Go runtime scheduler maps goroutines onto threads, and why goroutines are lightweight.
Golang portping: TCP checks with Ping and PingN (sequential, parallel, ranges)
Golang portping with janosgyerik/portping: set up module, Ping and PingN API, sequential and parallel TCP checks, port ranges, PingN result handling, retries, per-dial timing, CLI install, common dial errors; links to …

