GotchiCode needs JavaScript for the code editor and live challenges. Please enable it to play.
GotchiCode
Paths
Courses
Community
Arcade
Leaderboard
◂
Learn to Code in Python
▾
Before You Battle
0/9
How Lessons Work
10 XP
What Is a Program?
10 XP
Values and Their Types
10 XP
Naming Your Gotchi
10 XP
Your Gotchi's HP
10 XP
Expressions: Code That Makes a Value
10 XP
Level Up
10 XP
Seeing Your Values: print
10 XP
When Python Complains
10 XP
▾
Introduction
0/4
Hello, World
10 XP
Comments and pass
10 XP
Return, One More Time
10 XP
A Personal Greeting
10 XP
▾
Variables
0/3
Storing Values in Variables
15 XP
Adding Numbers
15 XP
Area of a Rectangle
20 XP
▾
Meet Your Creature
0/3
A Name Tag
15 XP
A Status Line
20 XP
Battle Cry
20 XP
▾
Battle Conditions
0/3
Is It Fainted?
15 XP
Who Strikes First
20 XP
Type Advantage
25 XP
▾
The Turn Loop
0/3
Total Damage
20 XP
Turns to Win
25 XP
Charge Bar
20 XP
▾
A Party of Creatures
0/3
Recruit a Creature
20 XP
The Strongest
25 XP
The Healthy Squad
25 XP
▾
Moves & Inventory
0/3
Move Power
20 XP
Learn a Move
20 XP
Known Types
25 XP
▾
Battle Functions
0/3
Damage Formula
25 XP
Healing Potion
25 XP
Apply a Move
30 XP
▾
Guarding Against Bad Input
0/3
Safe Stat
25 XP
Validate the Level
30 XP
Fix the Crash
25 XP
▾
Capstone: The Battle Simulator
0/2
Resolve a Round
35 XP
Simulate the Battle
45 XP
▾
Unique Encounters
0/3
How Many Distinct?
20 XP
Have We Met?
20 XP
New Discoveries
25 XP
▾
Battle Reports
0/3
Double Damage
20 XP
Filter the Survivors
25 XP
An HP Lookup
25 XP
▾
Team Records
0/3
Arena Coordinates
20 XP
Swap Sides
20 XP
The HP Range
25 XP
▾
Typed Battlers
0/3
Typed Stats
20 XP
A Typed Battle Cry
20 XP
Typing a List
25 XP
▾
Sharpen Your Logic
0/3
Ready to Battle?
20 XP
Within Range
20 XP
Pick a Target
25 XP
▾
Crunching Numbers
0/3
How Many Potions?
20 XP
Leftover Gold
20 XP
Power Level
20 XP
▾
Flexible Functions
0/4
A Default Greeting
20 XP
However Many Hits
25 XP
Build with Keywords
25 XP
However Many Keywords
25 XP
▾
Working with Strings
0/3
Split into Words
20 XP
The Party Roster
20 XP
Clean the Input
25 XP
▾
Working with Lists
0/3
Top Three
25 XP
The Front Two
20 XP
Find the Position
20 XP
▾
Working with Dictionaries
0/3
Combo Power
20 XP
Known Moves
25 XP
Total Party HP
25 XP
▾
Looping Tools
0/3
A Numbered Roster
25 XP
Pair Them Up
25 XP
Charge Countdown
25 XP
▾
Handling Exceptions
0/3
Safe Division
25 XP
Parse or Default
25 XP
Raise an Alarm
25 XP
▾
Formatting with F-strings
0/3
Two Decimal Places
20 XP
Line Up the Names
25 XP
As a Percentage
25 XP
▾
Set Operations
0/2
Shared Types
25 XP
Every Type Seen
25 XP
▾
Classes
0/3
A Creature Class
25 XP
A Damage Method
30 XP
Down for the Count
30 XP
▾
The collections Module
0/2
Counting with Counter
25 XP
Grouping with defaultdict
30 XP
▾
Lambdas & Sorting
0/3
Sort by a Key
25 XP
The Strongest
25 XP
Shortest Names First
25 XP
▾
Recursion
0/2
Factorial
30 XP
Recursive Sum
30 XP
▾
Inheritance
0/2
A Specialized Creature
30 XP
Calling super()
30 XP
▾
Dunder Methods
0/3
A Readable Creature
25 XP
When Are Two Equal?
30 XP
The Size of a Party
25 XP
▾
Generators
0/2
A Countdown Generator
30 XP
Doubling Generator
30 XP
▾
More String Methods
0/3
Search and Replace
20 XP
Does It Start With?
20 XP
Count the Hits
20 XP
▾
Decorators
0/2
A Simple Decorator
30 XP
A Guard Decorator
30 XP
▾
Context Managers
0/2
A Context Manager
30 XP
The contextmanager Decorator
30 XP
▾
Iterators
0/2
Build an Iterator
30 XP
An Iterable Collection
25 XP
▾
The itertools Module
0/2
Chain Two Parties
25 XP
Every Matchup
30 XP
▾
The functools Module
0/2
Reduce to One Value
30 XP
Cache With lru_cache
30 XP
▾
Regular Expressions
0/3
Valid Name?
25 XP
Pull Out the Level
30 XP
Slugify the Name
30 XP
▾
Enums
0/2
Define an Enum
25 XP
Using Enum Members
30 XP
▾
Dataclasses
0/2
A Dataclass
25 XP
Defaults & Methods
30 XP
▾
Properties
0/2
A Computed Property
25 XP
A Guarded Setter
30 XP
▾
Static & Class Methods
0/2
A Static Method
25 XP
A Classmethod Factory
30 XP
▾
Structural Pattern Matching
0/2
Match a Value
25 XP
Match a Shape
30 XP
▾
JSON
0/3
Write the Save
20 XP
Load the Save
20 XP
Names From a Save
25 XP
▾
Unpacking
0/3
Tuple Unpacking
15 XP
Starred Unpacking
20 XP
Merging Dictionaries
20 XP
▾
Conditional Expressions
0/3
The Conditional Expression
15 XP
Never Below Zero
15 XP
A Falsy Fallback
20 XP
▾
Scope
0/3
The global Keyword
20 XP
Closures with nonlocal
25 XP
A Running High Score
25 XP
▾
Custom Exceptions
0/3
A Custom Exception
20 XP
else & finally
25 XP
Chaining Exceptions
25 XP
▾
Abstract Base Classes
0/3
An Abstract Base Class
20 XP
Implementing the Interface
20 XP
One Interface, Many Types
25 XP
▾
Type Hints in Depth
0/3
Optional Values
20 XP
Union Types
20 XP
Generic Functions
25 XP
▾
The Turn Queue
0/3
The Turn Queue
20 XP
Shuffling the Line
20 XP
The Last Few Hits
25 XP
▾
Stat Records
0/3
Named Fields
20 XP
A Fresh Copy
25 XP
Back to a Dictionary
20 XP
▾
Cooldowns & Dates
0/3
Counting the Days
20 XP
When the Cooldown Ends
25 XP
Is the Move Ready?
20 XP
▾
Prepared Moves
0/3
A Move with Power Built In
25 XP
Remembering the Answer
25 XP
Pinning a Keyword
20 XP
▾
Save Paths
0/3
Reading a Path
20 XP
Which Folder?
20 XP
Naming the Backup
25 XP
▾
Priority Order
0/3
The Top Two
20 XP
Slowest Acts Last
25 XP
Keeping the Leaderboard Sorted
25 XP
▾
Cloning Creatures
0/3
Clone, Don't Alias
20 XP
Deep Copies
25 XP
A Safe What-If
25 XP
▾
Sorting Tools
0/3
itemgetter
20 XP
itemgetter with Dictionaries
20 XP
attrgetter
25 XP
▾
Battle Statistics
0/3
The Average
20 XP
The Middle Value
20 XP
The Most Common
25 XP
▾
Tidy Battle Logs
0/3
Shortening Long Text
20 XP
Wrapping Paragraphs
25 XP
Indenting Blocks
25 XP
▾
Roster Files
0/3
Reading CSV
25 XP
Writing CSV
25 XP
CSV with Headers
30 XP
Loading lesson…