Thursday 26 February 2015

Python Evidence - Session 6 - Write/Read Files

Using Python Basics - Writing to and Reading Files

Lesson Objectives


Use Python to write to a text file
Add data to an existing file
Use Python to read() the contents of a file



Starter
Copy the following Key Words and Definitions in to your book.

Main
Red Task
Create and write to a simple text file using Python.







~~~Evidence~~~
1. Create a program that uses write() mode to create a file that contains some simple text. 
Then use the print() function to print the contents of the file.



Orange Task
Add text to an existing text file using Python.




~~~Evidence~~~ 
2. Write a program to add 3 new lines of text to your file.
 - print it, stick it in your book and write a note to explain what you've done


Green Task
Create a program that will simply read() the contents of your file and display it on the screen.








~~~Evidence~~~ 
3. Write a program that will open() and read() the contents of your file and display it in the screen.
 - print it, stick them in your book and write a note to explain what you've done




Extension Task
Try these EXERCISES



Blog Post (to finish for hwk)
Add the following notes/code snippets to your  blog entitled
 'Writing to and Reading a File in Python'
 


Plenary

Further reading:


Homeowrk
Spend at leasst 30 minutes working on Code Academy - http://www.codecademy.com/learn

Wednesday 25 February 2015

Data Representation - Images

Lesson Objectives

To remember that computers interpret only zeros and ones (binary)
To understand how an image is represented by pixels(picture elements) in binary format
To recognise why metadata needs to be included in an image file(height, width, colour depth)

Starter

How are images represented on the computer?

Main

Red Task

Download and complete the Bitmap Images file HERE


Orange Task
 
TASK - on squared paper


Green Task
Do some research on Lossy and Lossless compression.

Find an image and open in a graphics package of your choice. 
Save a version of the file in a Lossy format and a second copy in a Lossless format.

Look at the file size and image quality. 
What do you notice?

Use fileinfo.com to investigate other file formats

Extension
Images in Computing TEST


Further Reading

Plenary


Add a post to your Blog about how images are are stored on the computing.

Try to include as many of the following key words as you can:



Bitmap
Pixel
File Size
Resolution
Metadata
Compression
Lossy
Lossless


Wednesday 11 February 2015

Data Representation - Hexadecimal

Lesson Objectives

 - understand the term Hexadecimal
 - be able to convert between binary, decimal and hexadecimal


Starter

 


1. Do you know what #FFFFFF means in computing?
2. What about
#000000?
3. Which of these is easier to remember: 01011011 or 5B?

Like ASCII, Hexadecimal is another Character Set that you should be familiar with. It was 

Main

Red Task:
Read through the following and then try to explaining it to a friend:




Orange Task:
1a. On paper, copy the following Hex numbers then show your working out as you convert to Binary

1b. Similarly, copy the following Decimal numbers then show your working out as you convert to Hex


2a. Open the email I have sent you containing an Excel file called Hexadecimal Activity OR download it HERE

2b. Insert a snipping of your completed Hexadecimal Activity on your blog (to finish for hwk if not completed in class)



Green Task

 Add a post to your blog with the title Hexadecimal. Use text. images, video or a combination of all 3 to explain what you understand by the term Hexadecimal. You might want to include and explain this image:





Plenary

Test Yourself
Have a go at the Introduction to Binary test HERE

Have a go at the Binary test HERE
Have a go at the Hexadecimal test HERE


Useful Websites
Cambridge GCSE Computing
http://www.color-hex.com/
Teach-ICT
Binary Translator
Hex Colour Codes
Computing Academy

Thursday 5 February 2015

Python Evidence - Session 5 - Lists

Using Python Basics - Lists

Lesson Objectives

 - learn the structure of lists
 - understand indexing in  lists
 - create a program using lists

Starter
Copy the following Key Words and Definitions in to your book.



Main
Knowing how to write a list in Python is very useful and if you use the correct conventions Python will instantly recognise your list as a list.



Red Task
Create a list to hold members of your family. Then use the print() function to print out their names as shown.




~~~Evidence~~~
1. Create a program that will print out members of your family, using a list as reference. 
- print it, stick it in your book and write a note to explain the structure of the list


Orange Task
Create a different list and use the print() function to identify different elements.



~~~Evidence~~~ 
2. Write a program using a second list 
 - print it, stick it in your book and write a note to explain what you've done


Green Task
Do some research on List Attributes, in particular:
1. length - len() 
2. count list - count()
3.  add to - append()
4. delete - remove()
5.sort - sort()

Use the code below to help you create your own list attributes - try at least 3 of the 5 given
~~~Evidence~~~ 
3. Write a program that counts the number of elements in a list as well as the length of the list.
4. Write a program that adds something to a list and removes something from a list

 - print both, stick them in your book and write a note to explain what you've done




Blog Post (to finish for hwk)
Add the following notes/code snippets to your  blog entitled
 'The structure of a 
list' 

Plenary


Further reading:
 - http://learnpythonthehardway.org/book/ex32.html

Homeowrk
Spend at leasst 30 minutes working on Code Academy - http://www.codecademy.com/learn