Classes

Monday, 5 December 2016

Python - Functions



Lesson Obj:
To understand how to use and call functions in programming using Python.

Starter:
Go to Lightbot and play the whole of Level 2 which is on Procedures.


What does a procedure do in Lightbot? What is it's purpose?

Main:
Choose worksheet 1 or 2 depending on how much challenge you want - remember more dojo points for trying out new things!
Worksheet 1 - has some hints as to what the mistakes in the coding might be.
Worksheet 2 - has no hints as to what the mistakes are!

You can copy out the code below to save you time with the rabbit, and then type out the rest of your worksheet.

def pullRabbit():
    print ("    ,__           ")
    print ("   / /^\  ,____   ")
    print ("   \_), ^^  _, \  ")
    print ("      / @ @ \(_/  ")
    print ("  ___{_-.x.-_}__  ")
    print ("(_______________) ")
    print ("     |       |    ")
    print ("     |       |    ")
    print ("     |       |    ")
    print ("     |       |    ")
    print ("     |_______|    ")


Once complete - take a screenshot and place it in your evidence document on Google Classroom. 
Make sure you fully annotate your work!

Plenary:
Let's play a kahoot or go on code combat!

Sunday, 20 November 2016

Algorithms Evidence Document

Lesson Obj:
To evaluate computation and abstraction knowledge using evidence document.

Starter:
Get logged into your emails and open up your evidence document which you have been working on in previous lessons.
Either go via Google Classroom or click on the nine squares and then choose Docs.

Main:
Make sure that you ALL of your sections are complete and that you have all the screen shots you need (are they big enough for me to see properly so that I can mark?)

Once you have fully annotated your work you must answer the evaluation questions with complete and detailed answers.


Make sure that your spellings are all 100% correct too!











Once this is complete - have a look at the self assessment. Write a comment about how your first term has gone and also whether you have enjoyed what you have studied. What did you think has gone particularly well and what were the challenges?
Switch places with a partner and look through their evidence document and write a constructive comment about their work:
What two things have they done well?
What is one thing that they could work on?


Plenary:
Have a look at the Blocky Maze website and complete the levels.
Make sure that you have completed your evidence document and then hand it in so that I can mark it.

Python Loops and Boolean



Lesson Obj:
To understand how to create a loop in Python and use a Boolean variable to define when to stop.

Starter:
Look at your worksheet - can you spot the mistakes AND correct them?

Main:
The main keyword to learn today is Iteration - but what does this mean??
Read through the following link
BBC Bitesize - Iteration

So there are two types of loops...

1. FOR loop. This is a count controlled loop.
If you know you want to run around the track 3 times then you would use a FOR loop. Every time you complete a lap then you counter would increase by 1. Once your counter is equal to 3 then you can stop.


Image result for running track
2. WHILE loop. This is a condition loop.
If you are unsure of how many times you will complete something e.g. taking penalties in a shootout then you would use a WHILE loop. You will continue to take penalties until one of the teams has scored more than the other. This could be within the five shots each but it could go on if the scores are tied.

Image result for football pitch

Grab a worksheet from the front to type into Python IDLE. There are some varying difficulties to go for a more straightforward sheet if you are unsure or go for a challenge!
When you press F5, remember to save your work in your Year 8 Python folder as "Loops and Iteration"

Go to Google Classroom and find you class - there is a new Evidence Document for you to complete.
Screenshot your Loop work into the correct section and annotate - what does the WHILE or FOR do?

Plenary:
Open up your previous work - "Hello World" and "Calculator" (you need to find it in your docs, right click and then choose Edit With IDLE).
Screenshot the appropriate information from these lessons into the correct sections and annotate your work.

Tuesday, 15 November 2016

Python - Calculator

Lesson Obj:
To understand how to use selection to create a simple calculator.

Starter:
Recap on what you learnt last lesson - click HERE.
What do you think the terms - integer and float mean?

Main:
Open up a new file in Python 3.4 - IDL

Copy the following code:

Capture1.PNG

Run the program (press F5)
Save as Calculator
Input a number and press enter then input another number and press enter.
What happens? Were there any errors?

Now we are going to look at adding in more complex features - we are going to let the user decide which operator they want to use.

  • Add (+)
  • Subtract (-)
  • Multiply (*)
  • Divide (/)
Edit your program with the following code:

Capture2.PNG

Run the program (press F5)
What happens? Were there any errors?

Extension:
Use your knowledge of coding to now make it work with multiply and divide - use the operator symbols which I have listed above and put your code where it says #HERE (you can delete this line of code!)

Plenary:
Print screen your code into your evidence document which is on Google Classroom and annotate it to explain what each line is doing.

Monday, 14 November 2016

Pseudocode and Logo

Lesson Obj:
To apply sequencing techniques using pseudocode and an interactive resource.

Starter:
Listen to the instructions that I read out...
What shape did you draw??

Main:
How could I create this shape?


Are there any ways we could improve our instructions? Why did we say them they way we did?

Go to Logo and have a go at producing a range of shapes - there are worksheets at the front to help you! 

Go to Google Classroom and open up your evidence document. 
You need to screenshot your pseudocode for some of your shapes in the correct section and explain how you created it e.g. did you use 'repeat'?

Share your ideas with each other and think about how you can further improve your work. 

Plenary:
Make sure your evidence document is all up to date and is as explained as can be! 
If you did not get chance last lesson - whizz through the lightbot levels and print screen your work into the correct section.

Monday, 7 November 2016

Lightbot Flowcharts

Lesson Obj:
To develop sequencing skills using online resources

Starter:
Recap on five rules for giving good instructions??

Main:



Look at the picture above and go to draw.io - can you draw out a flowchart to get lightbot to complete the level?
Think about what symbols you will use?



Open up Google Classroom and make sure that you are in the right class and can see my posts.
Open the Uni 1: Algorithms Evidence Document.
Take a print screen and paste it in to the first box. Annotate your flowchart where you can to explain the shapes and order.

Continue to work through Lightbot to the furthest level you can.

Plenary:
Screenshot the furthest level you get to into your evidence document.


Python - Hello World

Lesson Obj:
To understand and be able to use basic Python syntax.

Starter:



Main:
Make a new folder in your sites called "Year 8 Python"
Open Python 3.4 IDLE - select 'New File'

Write a program that will display Hello World.
Save and Run the program.

Think of other ways to interact with the computer - what other questions could you get it to ask?



  • Favourite film
  • Favourite food
  • Age
  • Gender 
Keywords: string, variable, if, else, elif

Plenary:
Add screenshots of your coding onto the evidence document which I have sent via Google Classroom.