Description

Introduction to Python for intermediate or advanced coders in upper middle or high school. In this advanced lesson plan, students will be introduced to Python as they complete engaging lessons, solve challenging puzzles, and build their own games in Python. This course is ideal for students who have already completed at least one Tynker course and are comfortable with the basics of programming logic and computational thinking. This course will help them transition to Python and adapt to the additional challenges of text-based syntax.

Students who successfully complete this lesson plan will demonstrate a strong mastery of Python syntax, as well as the ability to creatively program games and other projects and debug their own code. Students will also be able to come up with an idea for a game and take it through the entire design and implementation process, creating custom versions of many of their favorite games in Python.

Topics Covered: Python syntax, sequencing, repetition, conditional logic, nested loops, automation, pattern recognition, simple motion, keyboard and mouse events, pen drawing, operators, expressions, variables, Turtle graphics, using arrays and objects to store structured data.

What Students Learn

  • Day 1: Python Basics
  • Day 2: More Python Basics
  • Day 3: Python Game Design
  • Day 4: Python Games
  • Day 5: Collaborative Exercise

Technical Requirements

* Online courses require a modern desktop computer, laptop computer, Chromebook, or Netbook with Internet access and a Chrome (29+), Firefox (30+), Safari (7+), or Edge (20+) browser. No downloads required.

Introduction

Welcome to Python Coding, Tynker’s first Python course for camps and after-school programs. This course prepares campers for the rigors of AP Computer Science when they get to high school and bridges the gap between block-based coding and text-based coding. We recommend Python Coding for intermediate or advanced coders in upper middle or high school who have already completed at least one of our block-based coding courses to get comfortable with basic programming concepts.

In this advanced course, campers will be introduced to Python as they complete engaging lessons, solve challenging puzzles, and build their own games using Python. As they work through the different modules in Python Coding, campers will gain a strong mastery of Python syntax, as well as the ability to creatively program games and other projects and debug their own code.

Recommended Before You Begin:

  • Watch this video: https://player.vimeo.com/video/193816260

  • Have your campers complete at least one Tynker Course that teaches programming fundamentals using block-based coding

  • Review how this course is different from our block coding courses in the table below

What's Included:

  • 13 scaffolded, self-guided lessons, approximately one hour each

  • 13 lesson plans (one for each lesson) with helpful tips

  • Answer keys for all puzzles, quizzes, and DIY (do-it-yourself) activities

Python Coding is separated into three sections:

  • Part I - Python Syntax and Basics: In the first part of the course, campers will learn basic Python syntax and programming as they go on a jungle adventure to discover hidden treasures. They will use Python to navigate a character, avoid enemies, and collect treasure along the way.

  • Part II - UI and Interaction: The second part of the course teaches campers to use the turtle tool, background color, x-y coordinates, keyboard interaction, and pen drawing.

  • Part III - Game Design: This final portion of the course focuses on putting together everything campers have learn to build games. Campers will even build several games on their own!

How is this course different from Tynker’s block coding courses?


Block Coding Course

(e.g. Game Design 101)

Text Coding Course

(e.g. Python Coding)

How Students Code

Connect code blocks in Tynker Workshop

Write text commands in a code editor

Interactivity Level of the Modules

Highly interactive with concept introductions, guided tutorials and puzzles.

More reading required to understand Python syntax and apply concepts.

Types of Activities

Puzzles, guided tutorials, DIY projects, quizzes

Puzzles, DIY projects, quizzes

Syntax Checking

N/A

Syntax highlighting and error messages in the editor

Student Project

Tynker Projects

Tynker Notebooks

Teacher Experience

None required. Completely self-paced.

Some teacher experience required.

How to Assign Lessons

Classroom → Lesson tab

Classroom → Lesson tab


Your campers will be able to move through modules and lessons at their own pace. As the teacher, you have access to answer keys for all puzzles and quizzes, as well as completed samples for all do-it-yourself projects. Your Gradebook allows you to check how your campers are doing in real time. It includes metrics on which modules campers have completed, as well as which concepts they understand or are struggling with. This information makes it easy to know where your assistance would be most helpful and provide accurate solutions and tips. For more information about setting up your class and starting to teach, check out our teacher training videos and quick-start teacher guide.


Topics covered: Python syntax, sequencing, repetition, conditional logic, nested loops, automation, pattern recognition, simple motion, keyboard and mouse events, using the turtle graphics, operators, expressions, variables, collision detection, using lists and dictionaries to store structured data.


Lesson Plan

Lesson: The Basics

Time: 40+ mins

New Commands

  • forward()             Move the character one step forward.
  • turn_right()         Turn the character to the right.
  • fire()                     Launch an arrow that moves 5 units in the direction the character is facing.
  • turn_left()           Turn the character to the left.
  • jump()                  Make the character jump over a gap and land on the other side.

Vocabulary

  • Python: Python is a programming language that is widely used in web development, game development, and scientific research. Python is known for being highly readable and uncluttered, using whitespace indentation instead of curly braces or keywords. Because the Python language is meant to be relatively syntactically simple, Python developers use the invented adjective “pythonic” to describe code that is highly readable and written in a way that shows fluency with Python idioms.
  • Syntax: Syntax is the set of rules that govern how a language is structured. All languages have a syntax. In English, sentences have a syntax that may involve subjects, verbs, and objects. Python syntax is a set of rules that define what correctly formatted code looks like. But if you write a sentence in English with incorrect syntax, someone still might understand what you’re saying. If you write a line of code in Python with incorrect syntax, your program won’t run!
  • Command: A command is an instruction that you give the computer. For these puzzles, campers will use commands like “forward()” and “turn_left()” to communicate with the puzzle. The commands that campers use to solve puzzles are function calls.
  • snake_case: snake_case is a naming convention in Python and other languages. Variable and function names (identifiers) cannot have spaces in them, so if you have a variable that keeps track of player scores, you could name it “player_scores” to conform to snake_case conventions.
  • Identifier: Whenever you declare a function, variable, or data structure, you need to give it a unique name that you can refer to later. This unique name is an identifier. There are certain rules governing how you can name an identifier. For example, identifiers cannot be reserved words (such as “if”), they must begin with a letter or underscore, and they cannot contain certain symbols like exclamation marks, hyphens, periods, or commas.
  • Comment: If you use certain symbols in your code (such as “#”), these communicate to the computer that anything after them should be ignored when it compiles your program. This allows you to document your code by adding comments, which will help you debug your work and help other people understand what your code does. Comments in Python have the following syntax:

Objectives

Campers will...
  • Use Python commands to solve puzzle modules
  • Identify coding errors

Materials

  • Computers (1 per camper) with student account access to Tynker.com

Warm-Up (5 minutes)

Ask campers to answer these short-response questions:
  • What do you know about text-based programming languages (e.g., JavaScript, Python)? Have you ever used a text-based programming language?
  • Today we are going to solve Tynker puzzle modules using a text-based programming language called Python. What is one concern you have about using Python and one reason you’re interested in learning this language?

Activities (35 minutes)

Facilitate as campers complete The Basics modules on their own:
1. Welcome (Document)
    • Campers will read a short document that introduces the structure of the course.
    • Tell campers to click the “I’m Done” button (located at the bottom of the document) to move on to the next module.
2. Course Overview (Puzzle)
    • This short video introduces the Python Coding programming course.
3. Jungle Run (Puzzle)
    • In this module, campers are taught to use the “forward” command which moves the character forward one step each time it is used. The goal of the puzzle is to move the character to the pixie dust using Python commands.
    • Tell campers to write their code on the left side of the screen in the black coding field.
    • Remind campers to include empty parentheses () after every command.
    • Tell campers to click the orange “Play” button (located at the bottom right of their screen) to run their code.
4. More Dust (Puzzle)
    • This puzzle is similar to the previous one. Campers will need to use the “forward” command to move the character to the pixie dust.
    • Remind campers to spell the command correctly and end commands with open and close parentheses. Otherwise, their program will not run.
5. Around the Corner (Puzzle)
    • Campers are introduced to the “turn_right” command which will turn the character to the right by 90 degrees.
    • Tell campers that the “turn_right” command does NOT move the character forward, it will only change the direction it is facing.
6. Scale the Slopes (Puzzle)
    • This module introduces the “fire” command which launches an arrow that can travel up to 5 steps ahead in the direction the character is facing.
    • Campers will need to use the “forward” and “fire” commands to help the character defeat the enemy and reach the pixie dust.
    • Tell campers that the slopes do not count as a block (stone step), so one “forward” command will move the character to the next stone block.
7. Stairway to Safety (Puzzle)
    • Campers are introduced to the “turn_left” command which will turn the character to the left by 90 degrees.
    • Tell campers that the “turn_left” command is just like the “turn_right” command but instead of turning the character right, it turns the character left.
    • Campers will need to combine their knowledge of the “turn_left,” “fire,” forward,” and “turn_right” commands to move past enemies and reach the pixie dust.
    • Remind campers that the stairs do not count as a block (stone step), so one “forward” command will move the character to the next stone block.
8. What are Comments? (Document)
    • Campers will read a short document that introduces both single line comments and multi-line comments.
    • Check that campers are exploring the “Do it Yourself” module, which encourages campers to try commenting and uncommenting the given lines and adding their own.
    • Tell campers to click the “I’m Done” button to move on to the next module.
9. Around the Bend (Puzzle)
    • Campers will need to apply their knowledge of both the “forward” and “turn_left” commands to code the character to make a U-turn to grab the pixie dust.
10. Bunny Hop (Puzzle)
    • This module introduces the “jump” command which makes the character jump over a gap and land on the other side.
    • Remind campers that if an enemy is in the way, they need to get rid of it using the “fire” command.
11. What Are Naming Conventions? (Document)
    • Campers will read a short document that introduces rules when naming variables and functions in Python.
    • Tell campers to click the “I’m Done” button (located at the bottom of the document) to move on to the next module.
12. Left-Right (Puzzle)
    • Campers will need to combine all the commands from this lesson to help the character reach the pixie dust.
    • Are campers struggling? Encourage them to break down their code into smaller sections and identify at which line their code fails.
13. Review (Document)
    • Campers will read a short document that reviews concepts learned in this lesson.
    • Encourage campers to thoroughly read the document to help them prepare for the quiz in the next module.
    • Tell campers to click the “I’m Done” button to move on to the next module.
14. Quiz (Multiple Choice)
    • Campers will be asked 10 quiz questions to review concepts from this lesson.

Discussion Questions/Follow-Up Activities (20 minutes)

Lead a discussion with your campers:
  • Why is it important that programmers follow the same conventions for naming things in code?
  • What is an algorithm? How does solving a puzzle in Tynker require creating an algorithm?
  • Campers are starting to learn the rules--or grammar--of Python programming. How does Python grammar compare to English grammar? How flexible are the rules in each system? What happens if you don’t follow the rules in English (for example, by not capitalizing the first word of a sentence or using a double negative) versus when you don’t follow the rules of Python (for example, by naming an identifier with a reserved word)?
  • Bonus: Have campers write out valid and invalid identifiers and quiz each other on which ones are acceptable.

US Standards

  • CCSS-ELA: SL.7.1, SL.8.1, RI.9-10.3, RI.9-10.6, L.9-10.3, L.9-10.6
  • CCSS-Math: HSN.Q.A.1, HSN.Q.A.2, HSN.Q.A.3, MP.1
  • CSTA: 2-AP-13, 2-AP-17, 3A-AP-17, 3A-AP-19, 3B-AP-11, 3B-AP-12
  • CS CA: 6-8.AP.13, 6-8.AP.17, 9-12.AP.12, 9-12.AP.14, 9-12.AP.16
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d

UK Standards

National Curriculum of England (Computing)
Key Stage 3:
  • Design, use, and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
  • Understand several key algorithms that reflect computational thinking (for example, ones for sorting and searching); use logical reasoning to compare the utility of alternative algorithms for the same problem
  • Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures (for example, lists, tables, or arrays); design and develop modular programs that use procedures or functions
  • Understand simple Boolean logic (for example, AND, OR, and NOT) and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers (for example, binary addition, and conversion between binary and decimal)
  • Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds, and pictures) can be represented and manipulated digitally, in the form of binary digits
Key Stage 4:
  • Develop their capability, creativity, and knowledge in computer science, digital media, and information technology
  • Develop and apply their analytic, problem-solving, design, and computational thinking skills

Class Presentations

These student-facing slide presentations help educators seamlessly run Tynker lessons in a virtual or physical classroom setting. Each lesson has its own set of slides that introduce the big ideas, suggest unplugged activities, and include a section for each activity module. While running lesson slides, you can switch back and forth between the activity, the slides, answer keys and other lesson materials.
A sample slide presentation is available for your review. Please log in to view all the class presentations available with your plan..
Lesson 1
The Basics
28 Slides
Lesson 2
Loops and Patterns
32 Slides
Lesson 3
Conditional Logic
33 Slides
Lesson 4
Conditional Loops
23 Slides
Lesson 5
Variables
27 Slides
Lesson 6
Expressions
29 Slides
Lesson 7
Using the Turtle Tool
25 Slides
Lesson 8
User Interaction
24 Slides
Lesson 9
Game Design
20 Slides
Lesson 10
Snake
16 Slides
Lesson 11
Connect 4
15 Slides
Lesson 12
Tetris
16 Slides
Lesson 13
Final Game
15 Slides