Python programming

Area of Science:

Computer Science

Grade level:

AS / A level

Age of students:

17 Years

Total time:

2hr 30 mins

Preparation time:

60 mins

Teaching time:

1hr 30 mins

Teahing methodology to be used:

The Teaching methodology applied will be an inquiry-based flipped classroom, the students will be given the knowledge of Python programming along with practical activity, which comprises of 2 lessons. The lessons will be carried out practically, however the basic knowledge related to Python programming should be given before they commence the practical investigation.

Key concepts:

Introduction to Python programming, creating calculations, using IF statements, procedures, and functions, and creating loops. Practical Python programming will allow students to develop scripts using Python language. It also provides students with an opportunity to implement and develop object-oriented technologies in an event driven environment. They are able to state requirements and design, implement, test and evaluate their application.

Overview

Carry out the theory lesson to develop knowledge and understanding of the various approaches to the development of complex systems, the key stages in the development process and the outputs produced at each stage through programming.

Student mission

You are an engineer working in a Data Science company. The upsurge in the volume of unwanted emails called spam has created an intense need for the development of more dependable and robust antispam filters. You must develop a program that can classify emails as spam, and some are classified as not spam.

21st century technical skills gained through this activity

List of skills: 

  • Problem Solving, 
  • Practical analysis, 
  • Critical thinking, 
  • Drawing conclusions based on fact, 
  • Inquiry based learning.
  • Data Scientist
  • Applications Architect.
  • Enterprise Architect.
  • Data Architect.
  • Infrastructure Architect.

Differentiation strategies to meet diverse learning needs

Peer Mentoring, developing codes, Solving real life problems.Two 45 minutes lessons (If your lessons are shorter or longer, you can either break this sequence into more lessons or less).

Time to complete Lesson

Two 45 minutes lessons (If your lessons are shorter or longer, you can either break this sequence into more lessons or less).

Expected Learning Outcomes

           Introduction to Object Oriented Development

Know the appearance and basics of software and enhance more knowledge to develop programs and applications through graphical user interface.

  • Software
  • Defining Data
  • Program Control Structures
  • Objects
  • Data Structures
  • Defining Graphical User Interface (GUI) Objects
  • Understanding Events
  • Using Multiple Forms

Prior knowledge and vocabulary

Data, Objects, Class, data Structure, Exception.

Science and Engineering/Math Practices

Provide students with the printout of the Data structure and develop a small program for real life problems to help them with their investigative question. See Annex I.

Curriculum Alignment

CCEA GCE Software System Development: 

 

Unit AS 1: Introduction to Object Oriented Development 

  • Software
  • To demonstrate knowledge and understanding of the concepts associated with: −Systems software (management of file types/source/binary/executable/XML); and −Application development software (object-oriented platforms including open source).
  • Defining Data
  • Explain and apply primitive type; and reference (object) types. 
  • Identify and name objects. 
  • Explain that an object is an occurrence of a class.
  • Identify and name classes (abstract, base, and inherited classes).
  • Examine and apply the functions of classes (reusability).
  • Explain the use of a static variable within a class.
  • Examine and apply attributes and types to a class. 
  • Identify that attribute represent the properties of a class.
  • Identify the use of interfaces in relation to specific classes.
  • Program Control Structures
  • Apply and evaluate the basic principles of control structures in terms of: sequence (sequential functions, methods); repetition (unconditional, conditional); and selection (decision IF, nested IF, switch).
  • Objects
  • Apply and discuss the principles under pinning encapsulation, inheritance and polymorphism, for example: visibility (public, private and protected); and overloading and overriding methods.
  • Data Structures
  • Explain the need to store and organise data efficiently within specific structures.
  • Explain, design, and use the following data structures: strings; and static arrays (of simple type and of objects)
  • Exception Handling
  • Explain the need to be able to trap errors in program code.
  • Explain ways that errors can be trapped in an object-oriented environment and apply associated techniques.
  • Try/catch (blocks).

 

Unit AS 2: Event Driven Programming 

 

Defining Graphical User Interface (GUI) Objects

  • Demonstrate their understanding and use of GUI objects in the implementation of an event driven application. 
  • Understand and apply the features of: − GUI; and − forms (common components).

 

Understanding Events

  • Demonstrate and apply their understanding of events in the implementation of an     event driven application.
  • Use triggers, for example button, mouse clicks or key presses. 

 

Using Multiple Forms

  • Understand the use and application of multiple forms in an event driven application. 
  • Design and implement multiple forms for an event driven application. 
  • Implement appropriate navigation:
    • menus
    • toolbars
    • buttons

Lesson

Engage: Teacher helps students reflect on what they already know and identify any knowledge gaps. It is important to foster an interest in the upcoming concepts so students will be ready to learn. Teachers might task students with asking opening questions or writing down what they already know about the topic. This is also when the concept is introduced to students for the first time.

Students are given these video links prior to the class as per the inquiry-based flipped classroom strategy being employed. Students will look at the videos at home and complete an online quiz relating to the videos. They will also form their own questions and ideas, which will be prompted by the teacher through scenario based exercises during the lesson. The idea of asking and answering questions, formulating ideas will give the student a better understanding of the real-life solutions towards problems they will be solving. 

Materials: Video links, notes with embedded questioning

Before 1st lesson: 

 

 

Before 2nd  lesson: 

  • Graphical User Interface: https://www.youtube.com/watch?v=yQSEXcf6s2I

 

Preparation before each lesson: [ 20] Minutes to start the theory and practical.

Facilitation of Learning Experience: [10] Minutes 

Transition: [ 2] Minutes

Teacher will: lead the Q&A sessions, explain concepts at the beginning of each of the lessons

Students will: listen intently, take notes and ask questions

Explore: During the exploration phase, students actively explore the new concept through concrete learning experiences. They might be asked to go through the scientific method and communicate with their peers to make observations. This phase allows students to learn in a hands-on way.

 

Materials: PCs, Laptops, Pycharm, Programming language

Facilitation of Learning Experience: [30] Minutes 

Teacher will: Facilitate the understanding of programming language and practical class to develop pseudocodes. Teacher will lead informal assessment conversations in order to evaluate students’ understanding and offer students valuable real-time feedback. This will reinforce the essential feature of the inquiry-based classroom, where students have to give priority to evidence gathered through research.

  • 1st lesson: Introduction and Understand Object Oriented Development
  • 2nd lesson: Understand the basics of Event Driven Programming

Students will: Develop small programs and pseudocode for real life examples.

Explain: This is a teacher-led phase that helps students synthesise new knowledge and ask questions if they need further clarification. For the Explain phase to be effective, teachers should ask students to share what they learned during the Explore phase before introducing technical information in a more direct manner, according to “The 5E Instructional Model: A Learning Cycle Approach for Inquiry-Based Science Teaching.” This is also when teachers utilise video, computer software, or other aides to boost understanding.

Implement small-group activities during exploration, explanation and elaboration as they could be beneficial, because of peer-assisted learning. Through peer interactions, learners can work together on answering the questions to be investigated, discuss their findings or applying their acquired knowledge to varied tasks jointly.

Materials: PCs, Laptops, Pycharm, Programming language

Preparation: [3 0] Minutes 

Facilitation of Learning Experience: [5 – 10] Minutes 

Transition: [ 0] Minutes

Teacher will: further explain the theory behind programme and application development

Students will: listen intently and apply the knowledge

Elaborate: The elaboration phase of the 5E Model focuses on giving students space to apply what they’ve learned. This helps them to develop a deeper understanding. Teachers may ask students to create presentations or conduct additional investigations to reinforce new skills. This phase allows students to cement their knowledge before evaluation.

After each lesson, students are asked to work in groups and research the topic in more detail.  They will then prepare a presentation as a homework, and teach the class a different aspect of the programming activity. 

Materials: Power point software, student notes

Preparation: Approximately [60 ] Minutes for students to carry out research and prepare the slides

Facilitation of Learning Experience: [ 10] Minutes per group to present their lesson

Transition: [ 0] Minutes

Teacher will: Evaluate a presentation given by the students on what they found after the programming activity.

Students will: Present to the teacher and will answer relevant questions by the teacher to assess their level of understanding.

Evaluate: The 5E Model allows for both formal and informal assessment. During this phase, teachers can observe their students and see whether they have a complete grasp of the core concepts. It is also helpful to note whether students approach problems in a different way based on what they learned. Other helpful elements of the Evaluate phase include self-assessment, peer-assessment, writing assignments, and exams.

Students are given notes with post programming questioning and web links to programming sites to extend students understanding of the topics.

The post programming questioning could be left until the next class if your time runs over.

Students can also be given a test OR time bound assignments. 

Materials: Tests OR Time bound Assignments

Preparation: [ 10 ] Minutes 

Facilitation of Learning Experience: [5] Minutes to provide students with notes and post programming questioning. 

[45 -60 ] Minutes for a test or Time bound Assignments

Transition: [ 0 ] Minutes

Teacher will: direct students to resources to enhance their understanding OR Present the students with a time bound assessment based on their findings 

Students will: complete the embedded questions after watching the video links supplied by the teacher OR Answer the questions as fully as possible in the allocated time.

Independent learning tasks (ILT): Provide two-three challenges to students to complete before the next lesson. 

  • Students will watch the video links given to them by the teacher to enhance their knowledge and complete the related online quizzes.
  • Students will research real life applications of what they have learned within the classroom.
  • Students will answer post class questions 
  • Students will work in groups to prepare presentations and to present them to their class

Student feedback

Students will be given feedback on a one-to-one basis in a timely manner. The feedback will reference the skills outcomes that the assessment was designed to test and if the student met those outcomes. It will also take into account feedback from the student on how they found the lesson.

Curriculum mapping of outcomes attained

The knowledge gained in this lesson can be mapped against Object Oriented Development in the AS/A2 Digital Technology.

Assessment

Practical, student presentation, time bound assessment and Q&A.

Jump to:

Materials

This lesson plan will be accompanied with configuration for installation of python.

  • Windows 7 to 10, with minimum 2GB RAM (4GB preferable)
  • Operating system
  • Python and related packages
  • Program Worksheets

Preparation

Students should look at the video links provided and complete the online quizzes. They should also attempt questions in their notes, Q&A should be conducted by the teacher to ascertain if the students understand the concepts before starting the programming.

Team Work

Students will work in teams to research the topics and prepare a presentation for the class regarding the programming activities. This is an extension of the knowledge base, where students have to research more about programming in real life.

Rubrics

Include a scoring guide to evaluate the quality of students’ assessment responses.

Practical

*Options: The more options the more student autonomy. Teachers give the students options so that the student can develop their problem solving skills. The more options the teacher gives to students, the student has greater opportunities for problem based learning and independent learning. This is measured against the practical rubrics from zero independent to full independent learning.

 

Scale of Independent Work
Zero Independence A lot of Help with Some Independence  Semi Independent Fully Independent
Teacher gives students a full method with clear instructions for how to develop a code. Teacher gives students an outline for the procedure but allows options* at different steps. Teacher specifies the example. Students research the method to develop the code. Students choose real time example and try to solve all problems by developing programs 
Observation and Assessment of Competencies
Follow written and oral procedures Students follow written and oral instructions Students follow written and oral instructions, making individual choices in developing code. Students follow a method they have researched Students follow a method they have researched
Safely uses a computer and materials Students follow instructions on how to safely use the computer. Students follow instructions on the safe use the computer. Students minimise risks with minimal prompting. Students carry out a full risk assessment and minimise risks.
Makes records and results observations Students record results data in specified ways. Students record results data in specified ways. Students record precise and accurate data, methodically using appropriate example. Students choose the most effective way of recording precise and accurate data methodically using appropriate example
Researches, references and reports Data is reported and conclusions drawn. Students carry out presentations on the development of code with a lot of guidance. Data is reported and conclusions drawn. Students compare results and identify reasons for differences. Students carry out presentations on the development of code with some guidance. Students research methods available. They compare results and report on differences. Appropriate software is used to process data and report findings. Students carry out presentations on the development of codes with minimal prompting. Students research alternatives in order to plan their work. Reporting covers the planning, carrying out and an analysis of their results. Appropriate software and/or tools are used to process data and report findings. Students carry out presentations on the development of codes without the help of the teacher.
Analyses problems and identifies requirements: Identifies correct input/ output Students are unable to identify any input and output. Students are able to identify only one input or output. Students are able to identify correctly some input and output. Students are able to identify correctly all input and output and provide alternatives.
Demonstrates design solution: Constructs correct flowchart or pseudocode Students are unable to construct flowchart nor pseudocode.  Students are able to construct a flowchart or pseudocode but using incorrect symbols. Students are able to construct flowchart and pseudocode correctly. Students are able to construct flowchart and pseudocode correctly, use proper elements, symbols, and documentation
Applies required data type or data structure: Appropriate choice of variable names or data structure (i.e. array/ linked list) Students are unable to identify required data type or data structure. Students are able to identify required data type or data structure but do not apply them correctly. Students are able to apply required data type or data structure and produce partially correct results. Students are able to apply required data type or data structure and produce correct results.
Runs/debugs: Free from syntax, logic, and runtime errors Students are unable to run a program. Students are able to run a program but have logic error. Students are able to run a program correctly without any logic error, but display inappropriate output. Students are able to run a program correctly without any logic error and display appropriate output.
Performs input validation: Validates input for errors and out-of range data The students’ program produces incorrect results. The students’ program produces correct results but does not display correctly. It does not check for errors and out of- range data. The students’ program works and meets all specifications. It does some checking for errors and out of- range data. The students’ program works and meets all specifications. It does an exceptional checking for errors and out of- range data.
Produces readable programs: Indentation / Naming Convention Students are unable to organise the code. Students’ code is poorly organised and very difficult to read. Students’ code is fairly easy to read. Students’ code is extremely well organised and easy to follow.
Demonstrates program in front of the class Students are unable to explain program design. Students are able to explain a little program design. Students are able to explain the entire program design correctly as it is.  Students are able to explain the program design correctly and provide alternative solutions.

 

Written Practical Assignments

 

Name:—————— Course:————- Experiment: ————-

Criteria/Marks 4 Excellent (10 – 8 marks) 3 Good (7 – 6 marks) 2 Satisfactory (5 – 4 marks) 1 Unsatisfactory (3 – 0 marks) Score
Abstract Well-developed concise statement of results and methods, including all major components of the program with results. Competently written and clearly states conclusions of the program. Abstract includes a concise statement of results and methods, including most of the aspects of the program, but some details are missing or the results and/or conclusions are not clearly stated. Abstract misses one aspect of the program and/or results          

and/or conclusions. Overall the main aspects of the report are included and results are accurate.

A number of components of the program are missing.

Student does not understand how to write an  abstract. Results are not fully shown, and no conclusions are drawn. 

Notes:
 Theory A cogent, competently written theory section that includes the appropriate scientific sources to provide context for the development of the program and uses explanation to detail the relevant computer science principles. Flowchart and Pseudocodes are explained in   appropriate literature. The theory is presented but it doesn’t include appropriate scientific sources and it provides background for the program development and uses more description than explanation to detail the relevant computer science principles. Flowcharts are explained. Referencing of appropriate literature is unclear. The theory is presented but it doesn’t include appropriate scientific sources and it provides limited background for the program development. The relevant computer scince principles are listed and described. Flowcharts are stated but not explained. Referencing of appropriate literature is unclear with some parts missing.  The theory lacks background and appropriate scientific sources. Flowcharts are not stated.  No Pseudocodes are given.
Notes:
Materials/ Methods Well written method. All materials are listed. The method is written in a cogent, competent manner. The method should be clear to all who read it, including students’ peers.  The method is well-written and all materials are listed. Peers are able to follow the method.  The method is described. Some of the materials are not listed. Peers can follow the method, however, there may be some gaps.  The method is not described and/or incorrect, peers are not able to follow it. Materials are not listed. 
Data All figures, graphs, tables are accurately presented and contain titles and/or captions. The Flowcharts is well-organised and easy to understand. All Pseudocodes are completed accurately.  All figures, graphs, tables are mostly accurate and contain titles and/or captions with one omission. The flowchart section is organised and easy to understand. All Pseudocode are completed accurately.  Most of the figures, graphs, tables are accurate and contain titles and/or captions with more than one omission. The flowchart is organised. All pseudocodes are completed accurately with some minor errors. Figures, graphs, tables contain errors and/or are poorly constructed. Titles and/or captions are missing or incorrect. The Pseudocode are incorrect. 
Notes:
Criteria/Marks 4 Excellent (10 – 8 marks) 3 Good (7 – 6 marks) 2 Satisfactory (5 – 4 marks) 1 Unsatisfactory (3 – 0 marks) Score
Discussion All theory, data, and results are discussed clearly and accurately with comparisons that have been interpreted correctly and a very good understanding of results is conveyed. Students can make clear connections between development work and theory. Most theory, data, and results are discussed clearly and accurately with comparisons that have been interpreted correctly and a good understanding of results is conveyed. Students can make clear connections between development work and theory with minor omissions. Some theory, data, and results are discussed with correct interpretations, but some ambiguity. A limited understanding of results is conveyed. Students can make connections between development                                  work and theory with minor omissions. The discussion section is missing either theory, data or results. The interpretations are incorrect. Students display a lack of understanding of both the theory and development work. 
Conclusions All the major conclusions are  clearly stated, students show a very good understanding. All the major conclusions are clearly stated, students show a good understanding. Conclusions are drawn, but they are might not be fully explained. Students show a fair understanding.  Conclusions are missing or they are drawn, but incorrectly. Students show a lack of understanding.  
Notes:
References All referencing of sources (information and graphics) is completely accurate in line with your institutions style of referencing. All the references are from appropriate and reliable literature and they are crossed referenced for validity and accuracy of information (web source, article, book and journal). All referencing of sources (information and graphics) is completely accurate in line with your institutions style of referencing. Most of the references are from appropriate and reliable literature and they are crossed referenced for validity and accuracy of information (web source, article, book and journal). Some referencing of sources (information and graphics) is accurate in line with your institutions style of referencing. Most of the references are from appropriate and reliable literature and most of them are crossed referenced for validity and accuracy of information (web source, article, book and journal). References are either missing or incomplete/not from appropriate or reliable literature. No cross referencing.
Notes:
Grammar/ Spelling Grammatically correct in your own language. Does not require reader to make assumptions or have prior knowledge of the program development. Grammatically correct with minor omission. Does not require reader to make assumptions or have prior knowledge of the program development. Occasional grammar/spelling mistakes. Reader may have some minor questions after reading the practical assignment write up, but overall, they would have a good understanding of what the program development is about.  Frequent grammar and spelling mistakes. Reader will not understand what the program development is about. 
Appearance/ Formatting The entire assignment is written to the required format including font type and size, spacing, word count. Use of tables, charts, headers, bold text etc. to make the appearance more professional and clear to read.  The entire assignment is written to the required format including font type and size, spacing, word count with some minor omissions. Use of tables, charts, headers, bold text etc. to make the appearance more professional and clear to read. The entire assignment is written to the required format including font type and size, spacing, word count with several minor omissions. Use of tables, charts, headers, bold text etc. to make the appearance more professional and clear to read. Formatting and/or appearance is unacceptable. Student did not follow the required formatting. 
Notes:

 

Annex

Print or Download

Annex. I.

Data Structures in Python

Installation of Python

Step 1: Select Version of Python to Install. …

Step 2: Download Python Executable Installer. …

Step 4: Highlight the Install Now (or Upgrade Now) message, and then click it.

Step 5: Run Executable Installer. …

Step 5: Verify Python Was Installed On Windows. …