What Is a Code?
Hide messages.
What Is a Code? is a free Coding for Kids lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.
Secret Codes! 🕵️
Spies use secret codes to hide messages! 🤫 Only people who know the secret can read them.
Let's learn how to make our own!
What Is a Code? 🔐
A code changes a message so others can't understand it. HELLO might become IFMMP!
print('Secret messages are fun! 🤫')Text in Python 📝
Words inside quotes are called strings. Let's print one.
message = 'MEET AT NOON'
print(message)A Simple Swap 🔄
One easy code: swap a word for a secret word!
secret = 'banana'
print('The password is', secret)Backwards Code! ⏪
Reading a word backwards is a code too! Python can flip text with [::-1].
word = 'HELLO'
print(word[::-1])Flip It Back 🔁
To decode a backwards word, just flip it again!
code = 'OLLEH'
print(code[::-1])Letters Have Numbers 🔢
Every letter has a secret number! ord('A') shows it. A is 65!
print(ord('A'))Number Back to Letter 🔡
chr(65) turns the number back into a letter!
print(chr(65))Try Other Letters 🅱️
B is 66, C is 67... see the pattern?
print(ord('B'))
print(ord('C'))Shift a Letter ➡️
Add 1 to a letter's number to get the NEXT letter! A becomes B.
letter = 'A'
next_letter = chr(ord('A') + 1)
print(next_letter)Your Spy Name 🕶️
Make a fun secret agent message!
print('Agent 🕵️ reporting in!')
print('Mission: keep it secret 🤐')Quick Check ✅
What does chr(65) give us?
Code Beginner! 🏆
Great start! You learned:
- What a secret code is 🔐
- How to flip text backwards ⏪
- That letters have numbers with
ord🔢 - How to turn numbers into letters with
chr🔡
Next: shift letters to make a real cipher! ➡️
Learn Python with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 35
- Lessons
- 140
Frequently Asked Questions
Is the “What Is a Code?” lesson free?
Yes — the full text of “What Is a Code?” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO. The Coding for Kids course includes 4 lessons in total.
What will I learn in “What Is a Code?”?
Hide messages. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Coding for Kids?
No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.
How long does the “What Is a Code?” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Coding for Kids lesson?
Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Is a Code?
- Shifting Letters
- Encoding a Message
- Decoding a Message