0PricingLogin
Competitive Programming Academy · Lesson

Characters, ord & chr Tricks

Convert letters to numbers and back.

Letters Are Numbers

Every character your program reads is stored as a number under the hood. Knowing that code point lets you do math on letters. 🔢

Meet ord()

The ord() function turns a single character into its integer code point. It is your bridge from letters into arithmetic.

print(ord('A'))  # 65
print(ord('a'))  # 97

All lessons in this course

  1. Characters, ord & chr Tricks
  2. Count Letters with a Frequency Table
  3. Palindrome Checks Done Right
  4. Split, Strip & Rejoin Words
← Back to Competitive Programming Academy