Login
Discover
Waves
Communities
Raidstead
Write
Login
Signup
Topics
#
harold
Explore topics
#harold
Global
Trending
Hot
New
Payout
Muted
Promoted
#harold
Hot
#harold
Follow to get notified about new posts with this tag
Get #harold by email
Follow
thejudithgroup
hive
3d
Harold's Daily Code Example: Grouping items - November 26, 2026
Grouping related items can make a collection easier to summarize. from collections import defaultdict words = ['ant', 'apple', 'bee'] groups = defaultdict(list) for word in words: groups[word[0]].append(word)
$ 0.002
2
1
thejudithgroup
hive
4d
Harold's Daily Code Example: Finding an average safely - November 25, 2026
An empty list needs special handling because dividing by zero raises an error. def average(values): if not values: return None return sum(values) / len(values) print(average([2, 4, 6])) # 4.0
$ 0.000
1
thejudithgroup
hive
5d
Harold's Daily Code Example: Splitting a list into batches - November 24, 2026
Batching lets a program process a long list a few items at a time. items = [1, 2, 3, 4, 5] size = 2 batches = [items[i:i + size] for i in range(0, len(items), size)] print(batches) # [[1, 2], [3, 4], [5]]
thejudithgroup
hive
6d
Harold's Daily Code Example: Removing duplicates in order - November 23, 2026
Sometimes a list should contain each value only once without losing its original order. items = ['hive', 'code', 'hive', 'ai'] unique = list(dict.fromkeys(items)) print(unique) # ['hive', 'code', 'ai']
onemoretea
Actifit
2d
Promoted
The Waning Moon Above the Power Plant - My Actifit Report Card: November 26th, 2026
Welcome to Liquid Eye’s Actifit Blog Thursday ☀️ 10640 Another very cold morning, but still no snow. A quick, brisk ‘Three Bridges’ round of interval walking after a few warm-up and stretching exercises.
thejudithgroup
hive
7d
Harold's Daily Code Example: Counting words - November 22, 2026
A frequency table is a simple way to see which words appear most often. from collections import Counter words = 'learn share learn'.split() counts = Counter(words) print(counts['learn']) # 2 Counter returns
Explore communities