Toggle navigation
Chapters
Before getting started...
1: Create a Custom Calculator
2: What is a Computer Language?
3: Quiz Games and If Statements
4: Guessing Games with Random Numbers and Loops
5: Introduction to Graphics
6: Back to Looping
7: Introduction to Lists
8: Introduction to Animation
9: Functions
10: Controllers and Graphics
11: Bitmapped Graphics and Sound
12: Introduction to Classes
13: Introduction to Sprites
14: Libraries and Modules
15: Searching
16: Array-Backed Grids
17: Sorting
18: Exceptions
19: Recursion
20: Formatting
YouTube Playlist
Examples
Index of examples
Text Examples
calculate_miles_per_gallon.py
calculate_kinetic_energy.py
if_statement_examples.py
for_loop_examples.py
while_loop_examples.py
simple_encryption.py
simple_decryption.py
searching_example.py
property_check_examples.py
mudball.py
number_guessing_game.py
Graphics Examples
pygame_base_template.py
simple_graphics_demo.py
text_rotate.py
draw_module_example.py
bouncing_rectangle.py
bouncing_balls.py
animating_snow.py
functions_and_graphics.py
move_mouse.py
move_keyboard.py
move_game_controller.py
joystick_calls.py
bitmapped_graphics.py
array_backed_grid.py
instruction_screen.py
background_music.py
game_over.py
radar_sweep.py
timer.py
recursive_rectangles.py
fractal.py
timer.py
Sprite Examples
sprite_collect_blocks.py
moving_sprites.py
pick_up_blocks.py
moving_sprites_bounce.py
sprite_circle_movement.py
sprite_collect_blocks_levels.py
sprite_collect_circle.py
sprite_collect_graphic.py
sprite_collect_graphic_direction.py
sprite_rotating.py
game_class_example.py
move_sprite_mouse.py
move_sprite_keyboard_jump.py
move_sprite_keyboard_smooth.py
move_sprite_game_controller.py
pong.py
bullets.py
bullets_aimed.py
snake.py
Platformer Examples
move_with_walls_example.py
maze_runner.py
platform_jumper.py
platform_scroller.py
platform_moving.py
Full example
Practice
Quizzes
Worksheets
Labs
Tests
Track Progress
More Info
About the author
Buy the book
Learn Computer Science @ Simpson
My Twitter
Language
English
Chinese
Dutch - Nederlands
Finnish - Suomi
French - Français
Hungarian - Magyar
Korean - 한국어
Portuguese - Português
Russian - Русский
Spanish - Español
Turkish - Türkçe
What's New?
Better than Pygame, the Arcade library!
New book, Arcade Academy - Learn Python
11
Quiz: Sorting
Log in
Track your progress
Progress: Problem 1 of 9
Email Address:
Register
Reset Password
Password:
Log in
How many lines of code are normally used to swap two values?
3
2
4
5
Check Answer
Next