Python
Core language: strings, lists, dictionaries, numbers and the errors you meet along the way.
- Count Word Occurrences in a Python List
Count how often words appear in a Python list with list.count, collections.Counter, dict and defaultdict loops, normalization of case and punctuation, and pandas.
- Factorial in Python: Iterative, Recursive and math.factorial
Compute factorials in Python with a loop, recursion, math.factorial, reduce and memoization, with input validation, big integers and real timeit benchmarks.
- How to Create a Two-Dimensional Array in Python
Create 2D arrays in Python with nested list comprehensions or NumPy, avoid the [[0]*n]*m aliasing bug, and index, iterate, transpose and slice correctly.
- How to Generate Random Integers in Python
Generate random integers in Python with random.randint, randrange, sample, secrets.randbelow and NumPy's rng.integers, plus seeding, uniqueness and speed.
- How to Get Values From a Nested Dictionary in Python
Get values from nested dictionaries in Python: chained indexing, safe .get() chains, a deep_get helper, lists in dicts, recursion, json_normalize and glom.
- PySimpleGUI: Using an Image as a Button
Make image buttons in PySimpleGUI or FreeSimpleGUI with image_filename or base64 image_data, a borderless look, scaling, toggled images and event handling.
- Python: Split a String into a List (split, re.split, csv, shlex)
Split strings into lists in Python: str.split with and without sep, maxsplit, rsplit, splitlines, re.split for multiple delimiters, list(), csv and shlex.
- Trigonometric Functions in Python: A Complete Guide
Use math.sin, cos, tan, atan2 and hypot correctly in Python: radians vs degrees, inverse function ranges, float rounding, NumPy vectorization and cmath.
- TypeError: 'NoneType' object is not subscriptable in Python
Fix 'NoneType' object is not subscriptable: common causes (list.sort(), dict.get, re.match, JSON null), reading the traceback, and catching it with mypy.
- ValueError: could not convert string to float in Python (Fixes)
Why float() raises "could not convert string to float": empty strings, commas, currency symbols, N/A values, and how to fix them in Python and pandas.









