This course is part of Coding/STEAM Curriculum  Middle School Plan
Python 201
A deeper look at Python for intermediate or advanced coders in upper middle or high school with a focus on realworld computing problems. Request Quote
Course Summary
 Grades 8+
 Advanced level
 15 lessons
 Python

 Web
Course Includes
 15 lessons
 129 activities
 Enhanced Creativity Tools
 Automatic Assessment
 Tutorials and Reviews
 Coding Puzzles
 DIY Projects
 Quizzes
 Answer Keys
Prerequisites
No previous coding experience required.
Lesson Plan
Lesson: Data Types
Time: 40+ mins
Introduction
In this lesson, students are introduced to Python data types such as strings, numbers, and booleans.Vocabulary
 Data Type: A data type is a particular kind of data. The type of the data determines what operations or functions can be performed on that data. Different data types cannot be combined with each other without converting the data type. Strings, integers, floats, and booleans are examples of data types in Python.
 String: A string is a sequence of characters (letters) enclosed in either double or single quotes. Strings can be stored as variables and perform different functions on the strings. Individual pieces of a string can be accessed using an index, where the first character is stored in index 0.
 Concatenate: Joining two or more strings together to make one longer string. To concatenate strings, use a + symbol between the two strings. Concatenating strings creates a new string which contains all of the original strings.
 Integer: An integer is a positive or negative whole number. Integers should not be enclosed in quotation marks. Integers should be treated just like numbers and can be used in mathematical calculations.
 Floating Point Number (Float): A float is a number with decimal precision and is always displayed with a decimal point. When you combine floats and integers in a mathematical calculation, the resulting answer will always be a float.
 Boolean: A boolean is a value that is either True or False. In Python, the T and F in true and false must be capitalized. Boolean values are often used to create branching logic in programs.
Objectives
Students will... Define and use strings, integers, floats, and booleans
 Identify the difference between the four data types
 Apply coding concepts to convert strings to integers
 Apply coding concepts to convert integers to strings
Materials
 Computers (1 per student) with student account access to Tynker.com
WarmUp (5 minutes)
Ask students to draw a visual representation or describe one of the following similes: A variable is like a container for information
 A variable is like a labeled drawer that stores one item at a time.
 A variable is like a name tag that is put on a value.
 A variable is like an envelope that stores and labels a single value.
Activities (35 minutes)
Facilitate as students complete the Data Types modules on their own:1. Data Types (Tutorial)
 Students will read a short document that explains the fundamental data types in Python.
 Check that students are clicking the orange “play” buttons to instruct their computer to perform the given instruction.
 Do students need help with the “string names” puzzle? Give a hint: Tell them to use the code in the "Strings" section as a reference.
 Tell students to click the “Next” button (located at the bottom of the document) to move on to the next module.
 In this module, students will explore how the “+” operator concatenates two string by joining them.
 Do students need help with the “concatenate words” puzzle? Give a hint: Tell them to use the code listed above as a reference.
 In this module, students will practice using integers in their code.
 Ask students, “True or false: An integer is a positive or negative whole number.” (True)
 Optional: Before students select the “play” button, ask them to write down what they think the code will output.
 Tell students that the puzzle problem (titled “Add numbers”) is asking them to sum the total amount of moneynot the total number of coins.
 In this module, students will learn about floats and practice combining floats with integers.
 Optional: Can your students think of other situations when a computer should use a floating point number?
 Students are introduced to Python boolean values, which must be capitalized as either “True” or “False.”
 Optional: Can your students think of another situation that a computer might represent with a boolean value?
 Emphasize to students that in Python, values that are different data types cannot be combined with the “+” operator.
 In this module, students will need to identify the error.
 In this module, students will expand on functions and learn about the str function which produces the string version of its argument.
 Do students need help with the “Tonight’s reading” puzzle? Give a hint: Tell them to use the code listed above as a reference.
 Do students need another hint? Tell them that there is one space after the word “page.” Also tell them there is one space before and one space after the word “to.”
 This module contains two puzzles: “Age Difference” and “Input Sum.”
 In this module, students will learn how the int function produces an integer from its arguments.
 Optional: Before students select the “play” button, ask them to write down what they think the code will output.
 In this quiz, students will solve 5 different data type puzzles.
 In each problem, students will be given certain variables containing integers and strings. They will need to combine their values to produce the expected result.
 Note: Students may have to convert integers to strings and vice versa with the “str” and “int” functions.
Discussion Questions/FollowUp Activities (20 minutes)
Review the following with your students: Why should a computer use a floating point number when a selfdriving car is calculating what angle to turn the steering wheel? (for higher precision and higher accuracy)
 What is one thing you learned today about boolean values? (In Python, boolean values must be capitalized as either True or False.)
 What is a string? (A string is a sequence of characters) Who can give an example of a string? (A word, phrase, or story that is enclosed in a pair of quotation marks)
US Standards
 CCSSELA: SL.8.1, RI.910.3, RI.910.6, RI.1112.3, RI.1112.6, L.910.3, L.910.6, L.1112.3, L.1112.6
 CCSSMath: HSN.Q.A.1, HSN.Q.A.2, HSN.Q.A.3, MP.1, MP.2, MP.4
 CSTA: 2AP11, 2AP13, 2AP17, 3AAP17, 3BAP11
 CS CA: 68.AP.11, 68.AP.13, 68.AP.17, 912.AP.12, 912.AP.16
 ISTE: 1.c, 1.d, 4.d, 5.c, 5.d