7. Development basicsΒΆ
Programming languagesΒΆ
Please read and understand the following questions:
Whatβs the difference between a programming & scripting language?
What is a formal language, syntax, symantic?
What programming languages do you know?
Which difference will you get switching from one programming language to another?
Important
Take 30 minutes to research and answer the questions, then discuss them with your coach.
Install PythonΒΆ
As mentioned before, weβre making extensive use of Python, thus you need to have it installed on your operating system.
Head over to Python, download and install it.
Interactive Python shellΒΆ
In the Shell chapter, you already had your first contact with an interactive shell, most likely bash
.
Now weβre doing the same, but instead of bash
weβre using an interactive Python shell.
The following command should open a Python shell respectively the Python interpreter:
python3
Now you should be able to do your first operation:
>>> print('Hello There')
Hello There
>>> 1 + 2
3
You can now leave the Python shell by typing exit()
or pressing Ctrl-D
.
First Python scriptΒΆ
You executed your first interactive Python command. Now letβs focus on your first Python script.
Letβs create a script which simply multiplies 2 numbers:
number1 = 6
number2 = 7
print('Result is:', number1 * number2)
Save that script in a new file called
multiply.py
Open the shell and browse into the directory where the script is
Make sure the script is executable and interpreted by Python
Execute it
Hint
The output should look like this:
Result is: 42
Python principlesΒΆ
Now itβs time to learn Python.
Take all the Python lessons
If you done all the Python lessons, try the Python challenges without cheating
Code combatΒΆ
When youβve done the Python principles, head over to Code Combat and do this:
Play all the Kithgard Dungeon lessons
Note
If you want some change, feel free to switch between Code Combat & Learning Vi(m).