Scraping and Finding Ordered Words in a Dictionary Using Python (original) (raw)

Last Updated : 23 Feb, 2026

An ordered word is a word in which the letters appear in alphabetical order. For **Example:

Installation

Install the requests module, using the following pip command:

pip install requests

Approach

The task is divided into two main parts:

1. Scraping the Dictionary

2. Finding Ordered Words

Implementation

**Note: This article uses the public dictionary text file (unixdict.txt) available at https://www.puzzlers.org/pub/wordlists/unixdict.txt for scraping.

Python `

import requests

url = "https://www.puzzlers.org/pub/wordlists/unixdict.txt" fd = requests.get(url) c1 = fd.content.decode("utf-8").split()[16:]

for word in c1: if len(word) < 3: continue

if all(ord(word[i]) <= ord(word[i+1]) for i in range(len(word)-1)):
    print(f"{word}: Word is ordered")

`

**Output

not: Word is ordered
Jan: Word is ordered
not: Word is ordered
!==: Word is ordered
!==: Word is ordered
...: Word is ordered
...: Word is ordered
!==: Word is ordered
for: Word is ordered
for: Word is ordered
===: Word is ordered
!==: Word is ordered
!==: Word is ordered
........

**Explanation: