Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
env/
.DS_Store
.vscode
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# studi.my: 101 Beginning Python

The curriculum for studi.my: Beginning Python

This is the curriculum material to learn basic Python programming.
This is the syllabus for studi.my's basic Python programming.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to specify the site studi.my as this was meant to be generic and usable by others as well.

Table Of Contents:

- Introduction
- Data Types
- Variables, Statement & Expression
- Flow Control
- Functions
- String Manipulation
- Summary
- Introduction
- Data Types
- Variables, Statement & Expression
- Control Flow
- Functions
- String Manipulation
- Summary

## Copyright and licenses

Expand All @@ -24,7 +25,8 @@ Licensed under the Creative Commons Attribution 4.0 International Public License

Before you can build the documentation, you'll need to have Sphinx on you
system. We suggest that you do it witihin a virtualenv, like so:
```

```bash
$ virtualenv -p python3 $HOME/py3
$ $HOME/py3/activate
$ which pip
Expand All @@ -34,6 +36,4 @@ $ pip install Sphinx

### Create html pages

```
$ make html
```
`$ make html`
19 changes: 10 additions & 9 deletions source/data_types/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Data Types
===========
The Bigger Picture
-------------------
As you know, everything in a computer is represented as **1s and 0s**. If you are not sure how computer works,
we highly recommend you to watch `this interactive video <https://www.khanacademy.org/computing/computer-science/how-computers-work2/v/khan-academy-and-codeorg-binary-data>`_.
As you may know, everything in a computer is represented as **1s and 0s**. If you are not sure how computers work,
we highly recommend that you watch `this interactive video <https://www.khanacademy.org/computing/computer-science/how-computers-work2/v/khan-academy-and-codeorg-binary-data>`_.

In this topic, we explore **why we need Data Types**. Key question is, if a computer only
understands binary (1s and 0s), how does a human communicates with it?
In this topic, we explore **why we need Data Types**. The key question is, if a computer only
understands binary digits (1s and 0s), how can humans communicate with it?

Syntax and Semantics - Learning Python Grammar
----------------------------------------------
Expand Down Expand Up @@ -42,8 +42,8 @@ Now try this in IDLE.

.. topic:: FAQ / Common Issues

| 1. Help ! I got bunch of errors typing stuff inside ``type()`` built-in function.
| It's okay! Try to read and make sense the errors shown. Part of learning is to learn how to read error stack.
| 1. Help! I got bunch of errors when typing stuff inside the ``type()`` built-in function.
| It's okay! Try to read and make sense the errors shown. Part of learning how to code is learning how to read the error stack.

| 2. How can I possibly know all the built-in functions and data types in Python?
| Refer to :ref:`Quick Resources <quick-resources>` for all the built-in functions and data types available in Python.
Expand All @@ -52,23 +52,24 @@ Critical Thinking - Discussions
--------------------------------
1. What other types you found besides the common ``int``, ``float``, ``str``, ``bool``, ``None`` type ?
2. Can you type in Chinese or other languages ? What type is it?
3. If everything in computer is represented by 1s and 0s, how does it represent:-
3. If everything in computer is represented by 1s and 0s, how does it represent:

* 10
* 3.1243
* "hello world"
* "你好"

4. Can you imagine how images, files, sounds and other inputs get represented in Python?
5. Can you appreciate the value of having data types now ?
6. Can you think of other data types which needs to be represented ?

.. topic:: Fun Facts

Variables ``num1`` and ``num2`` above are intuitive to us cause we learnt them in Math class. It's simple algebra!
Variables ``num1`` and ``num2`` above are intuitive to us because we learnt them in Math class. It's simple algebra!

Best Practices
---------------
1. You might already notice by now Python has its documentation stored at https://docs.python.org/3/
1. You might have already noticed by now that Python has its documentation stored at https://docs.python.org/3/

Remember
--------
Expand Down
6 changes: 3 additions & 3 deletions source/flow_control/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
============
Flow Control
Control Flow
============
The Bigger Picture
------------------
Program executes from top-down approach but what if you want to take control of how it flows?
Programs execute from a top-down approach but what if you want to take control of how it flows?

This topic focuses on Python control flow statements.

Expand Down Expand Up @@ -41,7 +41,7 @@ Explore on your own to try the grasp how these flow statements work. Open up IDL
... print("b is the youngest!")
... else:
... print("c is the youngest!")

Critical Thinking - Discussions
-------------------------------
1. How do you form a condition ?
Expand Down
2 changes: 1 addition & 1 deletion source/function/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Functions
=========
The Bigger Picture
------------------
Problem solving is about **breaking down problem into mind-size bites** - decomposing. Function allows us to essentially do
Problem solving is about **breaking down problems into bite-sized pieces** - or rather, decomposing. Function allows us to essentially do
just that - divide the code into smaller chunks. What comes to mind when it comes to ``functions`` ? Hint: You
learn it in school!

Expand Down
14 changes: 7 additions & 7 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ What You Will Learn

.. topic:: Idea #1 - Data Types

How does human interacts with machine if it only understands 1s and 0s ? Data types allow help to represent numbers, strings, etc in human readable manner. Learn some of the basics built-in data types in Python.
How do humans interact with machines if it only understands 1s and 0s? Data types allow us to represent numbers, strings, etc in human readable manner. Learn some of the basic built-in data types in Python.

.. topic:: Idea #2 - Variable, Statement and Expression
.. topic:: Idea #2 - Variables, Statements and Expressions

Program needs a mechanism to "remember" instructions. Here is where you'll learn how to do it and the difference type of instructions - statements vs expressions.
A program needs a mechanism to "remember" instructions. Here is where you'll learn how to do it and the different types of instructions - statements vs expressions.

.. topic:: Idea #3 - Flow Control
.. topic:: Idea #3 - Control Flow

Program executes from top-down approach but what if you want to take control of how it flows? Conditional statement is one approach. Learn about using various operators to form conditions.
A program executes instructions from a top-down approach, but what if you wanted to take control of how it flows? Conditional statement is one approach. Learn about using various operators to form conditions.

.. topic:: Idea #4 - Function

Function is the core idea of breaking down problem into mind-size bite. Get an idea of how program works with function - input, process, output.
Functions are a core idea of breaking down problems into bite-sized pieces. Get an idea of how a program works with functions - input, process, output.

.. topic:: Idea #5 - String Manipulations

Strings in Python is very powerful - all symbols you can think of like Chinese, Arabic and even emojis can be represented as String in Python. Explore the built-in methods and other tricks to manipulate data in Strings.
Strings in are very powerful in Python - all the symbols you can think of, even Chinese or Arabic characters, and even emojis can be represented as Strings in Python. Explore the built-in methods and other tricks to manipulate Strings in Python.

.. toctree::
:maxdepth: 2
Expand Down
15 changes: 8 additions & 7 deletions source/introduction/index.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
============
Introduction
============
There are two main topics for understanding programming:-

1. Environment - the part that's installed on the computer/machine
2. Language - the part that's installed in the programmer's head
There are two main topics for understanding programming:

In order to learn effectively, this course will:-
1. Environment - the part installed on the computer/machine.
2. Language - the part installed in the programmer's head.

* Code in the Cloud - we will NOT go into Environment
* Focus on Problem Solving - break down problem into mind-size bites (decompose)
* Encourage critical thinking through questions / exploration (tinker on your own)
In order to learn effectively, this course will:

* Code in the Cloud - we will NOT go into Environment.
* Focus on Problem Solving - break down problem into bite-sized pieces (decompose).
* Encourage critical thinking through questions/exploration (tinker on your own).

Let's begin !

Expand Down
2 changes: 1 addition & 1 deletion source/string_manipulation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Bigger Picture

Python 3 strings are sequences of Unicode, not bytes. What is Unicode? Watch `this Tedx Talk <https://www.youtube.com/watch?v=IRdupNXpm8k>`_.

So, what does it means if Python strings uses UTF-8 unicode encoding?
So, what does it mean if Python strings uses UTF-8 unicode encoding?
Hint: Remember we asked earlier in **Data Types** topic how certain symbols like Chinese characters are represented in binary?

Syntax and Semantics - Learning Python Grammar
Expand Down
2 changes: 1 addition & 1 deletion source/summary/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Summary

**Congratulations**, you have leveled up! By now, we hope you have experienced solving problems with Python.

You might have realized how easy for humans to solve it but extremely difficult to break down solutions into step-by-step instructions for machine to understand.
You might realize how easy it is for humans to do so but it is extremely difficult to break down solutions into step-by-step instructions for machines to understand.

As you practice to solve more problems, you'll get better at it. Don't give up!

Expand Down
8 changes: 4 additions & 4 deletions source/variable_statement_expression/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=================================
Variables, Statement & Expression
=================================
====================================
Variables, Statements & Expressions
====================================
The Bigger Picture
------------------
In a nutshell, a computer program takes an input, store some values in the memory, do some processing and output the results.
In a nutshell, a computer program takes an input, stores some value in memory, do some processing and finally outputs the result.

Let's talk about storing values. How do you do that?

Expand Down