Showing posts with label json. Show all posts
Showing posts with label json. Show all posts

Monday, July 11, 2016

Python Code Camp (3 Days) For Kids Aged 12-18

Learning to code is all the rage nowadays. Even if you are not preparing for a career in the IT world, learning to program has the following benefits:
  • It fosters problem-solving skills
  • It promotes critical thinking
  • It prepares you for the future!


While it is never too late to start learning programming, the ideal age is to start as early as possible. And it is the exact motivation for this course.

This course is targeted at kids from the age of 12 to 18, who want to get started in programming. With so many programming languages available, what is the best language to get started? The answer is: Python. Python is a high-level programming language that is widely in use. Python code is readable, and its syntax ensures programmers write code that is well-indented and clear. Python is supported on most platforms and is well suited for a wide variety of tasks – ranging from automating your daily platform tasks, to running as a standalone Web Server.

What’s more, Python will be the language taught in the new O-level Computing subject (Secondary 3 level), starting in 2017.


In this course, kids will learn about the Python language, and how it can be used to solve problems. More importantly, kids will learn how to use Python in the real-world, such as how to fetch weather information continuously from a Web service and display it in a chart.

Topics
  • Introduction to programming
  • Getting started with Python
  • Strings
  • Arithmetic
  • Looping
  • Functions
  • Lists, Dictionaries, Tuples, Sets
  • Data Types
  • Modules
  • Connecting and fetching data from the outside world!
  • Displaying charts and graphs
Fee and Dates
  • 28-30 November 2016 (Mon-Wed)
  • 9am to 5pm
  • $950 per student (nett, no GST)
  • Early bird discount: Register before 30 Sep 2016 and receive a discount of $200!
  • Receive an additional discount of $50 when you register 2 students or more
  • Each student will get a free Python Code Camp T-shirt 
  • Course fee includes a lunch and 2 tea-breaks per day
  • Participant need to bring along his/her own laptop
Venue

        IBIS HOTEL
        170 Bencoolen Street 
        Singapore 189657

Tuesday, October 06, 2015

JSON: A 5-Minute Introduction

JSON is getting popular by the days. JSON stands for JavaScript Object Notation. It is used in data representation as well as data transmission.

To very if a string is a valid JSON string, use the JSONLint at http://jsonlint.com

JSON Data Types

JSON supports the following data types:
  • Object
  • String
  • Boolean
  • Number
  • Array
  • null

The following sections will elaborate on each of the data types.

Object


An Object is an unordered collection of key:value pairs enclosed in a pair of curly braces ({}). The following is an example of an empty object:

{}

String

The key in an object must be a String, while the value can be either a String, Boolean, Number, Array, null, or another Object.

The following shows an object with one key:value pair:

{
    "firstName": "John"
}

An object can have multiple key:value pairs, for example:

{
    "firstName": "John",
    "lastName": "Doe"
}

Note the comma (,) after John and there is no comma after Doe.

Each key in the Object must be unique. For example, the following example is not a valid JSON string:

{
    "firstName": "John",
    "firstName": "Doe"
}

Boolean

A Boolean value can either be true or false:

{
    "firstName": "John",
    "lastName": "Doe",
    "isMember": true
}

Number

A Number value can either be an integer, or a floating-point number:

{
    "firstName": "John",
    "lastName": "Doe",
    "isMember": true,
    "weight": 79.5,
    "height": 1.73,
    "children": 3
}

Nested Object

The value of a key can also be another Object, as the following example shows:

{
    "firstName": "John",
    "lastName": "Doe",
    "isMember": true,
    "weight": 79.5,
    "height": 1.73,
    "children": 3,
    "address": {
        "line1": "123 Street",
        "line2": "San Francisco",
        "state": "CA",
        "postal": "12345"
    }
}

Array

An Array is an ordered sequence of Objects:

{
    "firstName": "John",
    "lastName": "Doe",
    "isMember": true,
    "weight": 79.5,
    "height": 1.73,
    "children": 3,
    "address": {
        "line1": "123 Street",
        "line2": "San Francisco",
        "state": "CA",
        "postal": "12345"
    },
    "phone": [
        {
            "type": "work",
            "number": "1234567"
        },
        {
            "type": "home",
            "number": "8765432"
        },
        {
            "type": "mobile",
            "number": "1234876"
        }
    ]
}

Note that arrays are denoted with a pair of brackets ([]).

null

When a key has no value, you can assign a null to it:

{
    "firstName": "John",
    "lastName": "Doe",
    "isMember": true,
    "weight": 79.5,
    "height": 1.73,
    "children": 3,
    "address": {
        "line1": "123 Street",
        "line2": "San Francisco",
        "state": "CA",
        "postal": "12345"
    },
    "phone": [
        {
            "type": "work",
            "number": "1234567"
        },
        {
            "type": "home",
            "number": "8765432"
        },
        {
            "type": "mobile",
            "number": "1234876"
        }
    ],
    "oldMembershipNo": null

}