Codecademy comes strongly recommended by fellow Stryke Force developers and should be where you start learning the Python programming language.
This will get you up and running with Python 3 on a development laptop. You should be relatively comfortable with running commands and changing directories, setting permissions for files and folders from the command line.
- Launch the terminal and change directory to you home directory.
- Create a work directory if one doesn't already exist.
- Change directory to your work directory and launch the Atom editor:
atom . - Create
hello.pyand write a program to write "Hello, World!" to output.
#!/usr/bin/env python3
print("Hello, World!")- Back in the terminal, run you new script in Python 3.
~/exercises $ python3 hello.py
Hello, World!- Make the script executable and run it directly from the command line.
~/exercises $ chmod +x hello.py
~/exercises $ ./hello.py
Hello, World!See this python.org tutorial for an introduction to basic data types: An Informal Introduction to Python
Stop when you reach section 3.2, "First Steps Towards Programming".
Generate the first few numbers of the Fibonacci series by following section 3.2 of the python.org tutorial.
Continue the python.org tutorial on more control flow tools.
Stop when you reach section 4.6, "Defining Functions".
Continue the python.org tutorial on defining functions.
Stop when you reach section 4.7, "More on Defining Functions".