Sort Non English Words in Text File Using Python

Photo by Edu Grande on Unsplash

Here, we are going to sort text file that contains words and we will use it later as our dictionary. For english language we can simply use:

But if want to sort other language words just sorted()will not work. Try code below and make changes according to your language reqirenments.

In my case, text file containing words looks like this:

After sorting:

Give a clap if it worked for you👏🏼

--

--

--

Learner.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Python Exercises 1 — Basic

AWS re:Invent Session Guide: Security

How to leak memory with Subscriptions in RxJava

Pega CPBA and overview of process management

Synchrony Whitelist Application Process on SolRazr

Enreach: Guiding and Accelerating the Migration to a Microservices Architecture

Building a Python library for Tableau: URL endpoints for API calls

Flutter Experience — Beginner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Maryam Bibi

Maryam Bibi

Learner.

More from Medium

Python Fighting Game Project

Simple example in Selenium Python

Modules in python

Python Lesson 31: Fun with Python