Unit 5-06

Learning Outcome

At the end of this lesson, you will be able to:

  • understand and use a dictionary in a program

Review

  • lists

Lesson

  • go over Arrays, Chapter 5
    • Computer Based Problem Solving
    • "2D Arrays"

Activity

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}

print "dict['Name']: ", dict['Name']
print "dict['Age']: ", dict['Age']


dict['Name']:  Zara
dict['Age']:  7

Daily Assignment

  • create a program that loads the Unicode character set (a subset of it, just the characters) into a table
  • the stub program accepts a string and breaks it apart into characters
  • a function accepts a single character and returns a Hexidecimal number that is the Unicode for that character (see: http://unicode-table.com/en/)
  • the stub program returns the string, but in hex equivalent
  • create:
    • flowchart - only for the function
    • Test cases
    • code
    • screenshots
    • GitHub link

Extra

  • work on the weekly assignment

Homework!

  • read over Enmeration, Chapter 6
    • Computer Based Problem Solving
    • "Enumerated Types"