From 386a6adc11c09134f3050e09b94b4e8b6c595757 Mon Sep 17 00:00:00 2001 From: Artem Bryksa Date: Mon, 23 May 2022 19:42:18 +0200 Subject: [PATCH] Added more clarity to "Alphabetically last" exercise I think it would be useful to include information that comparison operators are used on strings by comparing the numerical representation of characters in Unicode, rather than by only saying that it is compared alphabetically. --- data/part-2/2-else-elif.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/part-2/2-else-elif.md b/data/part-2/2-else-elif.md index 9d7a7ae28..352b4ff1a 100644 --- a/data/part-2/2-else-elif.md +++ b/data/part-2/2-else-elif.md @@ -269,7 +269,7 @@ Bill and Jean are the same age -Python comparison operators can also be used on strings. String `a` is smaller than string `b` if it comes alphabetically before `b`. Notice however that the comparison is only reliable if +Python comparison operators can also be used on strings. Each character in Python is represented by a specific number in [Unicode](https://en.wikipedia.org/wiki/Unicode). For example, string `a` (number 97 in decimal representation of Unicode characters) is smaller than string `b` (number 98 in decimal representation of Unicode characters). You can see a list of Unicode characters [here](https://en.wikipedia.org/wiki/List_of_Unicode_characters#Latin_script). Notice however that the comparison is only reliable if - the characters compared are of the same case, i.e. both UPPERCASE or both lowercase - only the standard English alphabet of a to z, or A to Z, is used.