<style>
.highlight {
color: #EAC100;
}
.example{
color: #AFAF61;
}
</style>
# Python for Beginners # 1
<i class="fa fa-book fa-fw"></i> Made by Anna.
##### This is for non-native English speakers.
<br/>
Preparation
---
- [Install Python](https://www.python.org/downloads/)

- [Download IDE](https://code.visualstudio.com/)

<!--
- [Slide example](/s/slide-example)
- [YAML metadata](/s/yaml-metadata)
- [Features](/s/features)
-->
<br/>
Why is Python?
---
- [Python is the First Language You Should Learn](https://www.cbtnuggets.com/blog/technology/programming/python-is-the-first-language-you-should-learn)
- [Python Tutorial - W3schools](https://www.w3schools.com/python/)
<br/>
Basic Programming Vocabulary
---
##### <font class="highlight">Before start, you should know the following vocabulary!!</font>
* **algorithm**
(noun) a step-by-step procedure to achieve a specific goal. Can be implemented with code.
*Ex.* <font class="example">I used the quicksort algorithm to sort the array alphabetically.</font>
---
* **bug**
(noun) a mistake in a program.
*Ex.* <font class="example">There must be a bug because the output is wrong.</font>
* **debug**
(verb) to investigate and fix bugs.
*Ex.* <font class="example">I spent all day debugging a complicated error.</font>
* **syntax**
(noun) the grammatical rules of a programming language. Every programming language has different syntax. Syntax determines whether code is written correctly or incorrectly, and is enforced by the compiler or interpreter. Code will not compile or run unless the syntax is correct.
*Ex.* <font class="example">I forgot to write the brackets, so the compiler gave me a syntax error.</font>
---
* **compiler**
(noun) a program that converts instructions into a machine-code or lower-level form so that they can be read and executed by a computer.
*Ex.* <font class="example">Conversion would require more than just running it through a different compiler.</font>
* **execute**
(verb) Synonym for run.
*Ex.* <font class="example">I can’t execute my program because it won’t compile.</font>
* **run**
(verb) to perform the instructions written in code or an executable. Code is a set of instructions, and “running” code is when the computer actually performs those instructions. To “run” a function means to call that function (see call).
*Ex.* <font class="example">I wrote a new feature, and ran the code to check that it works.</font>
* **write**
(verb) to send output data values to an external destination – usually to a file. Can refer to sending data over a network, such as the internet. The opposite of reading.
*Ex.* <font class="example">The program writes all its data to a file before it quits, so it can read the data back again next time it is run.</font>
* **comment**
(noun) arbitrary text written around code, but which is never run, and is generally ignored by the computer. Used to leave notes and documentation for people who read the code later. Also used to stop code from running.
*Ex.* <font class="example">I wrote comments in my code so I could understand it later.</font>
* **comment out**
(verb) to turn code into a comment so that it does not get run.
*Ex.* <font class="example">I commented out this line of code, and it doesn’t crash any more.</font>
---
* **data structure**
(noun) a data organization, management, and storage format that enables efficient access and modification.
*Ex.* <font class="example">Arrays are one kind of data structure.</font>
* **type**
(noun) the kind or category of a value. Every value has a type.
* The value 5 is of the integer type.
* The value 5.2 is of the float type.
* The value "cat" is of the string type.
Simple types, like integers, are usually provided by the programming language. The programmer can define more complicated types using classes. The type of an object determines what methods and instance variables are attached to that object.
*Ex.* <font class="example">I got a crash because the variable contained the wrong type of value – I thought it would be an integer, but it was actually a string.</font>
* **value**
(noun) a piece of data that can be contained inside a variable. Every value has a type. Values represent information, in a way that code can work upon. Code can:
* send and receive values over the internet
* save values into files
* convert values into different values
* etc.
*Ex.* <font class="example">My program asks a user for the year they were born, then uses that value to calculate their age.</font>
* **variable**
(noun) a data item that may take on more than one value during the runtime of a program.
* **constant**
(noun) a variable that never changes its value.
*Ex.* <font class="example">The PI constant has the value 3.14.</font>
* **integer**
(noun) a type of value that represents whole numbers. For fractional numbers, see float.
*Ex.* <font class="example">42 is an integer value.</font>
* **float**
(noun) a type of value that represents numbers with fractional parts. Short for “floating-point number”.
*Ex.* <font class="example">The value 3.14 is a float.</font>
* **double**
(noun) a float that can represent a wider range of numbers than a normal float. Short for “double-precision floating-point number.” See float.
*Ex.* <font class="example">The number was so tiny I had to use a double instead of a float.</font>
* **string**
(noun) a type of value that represents text. The word “string” derives from the phrase “string of characters.” E.g. The string "cat" is a string (a.k.a. sequence) of the characters ‘c’, ‘a’, and ‘t’.
*Ex.* <font class="example">I represented my name as a string in the code.</font>
---
* **list**
(noun) a collection which is ordered and changeable.
* **array**
(noun) a type of value that contains a sequence of other values.
*Ex.* <font class="example">I put all our names into an array of strings.</font>
* **loop**
(noun) a piece of code that runs itself repeatedly. Commonly used to run a piece code for every value in an array. Also known as “iteration”.
*Ex.* <font class="example">The code loops until the user types in “quit.”</font>
* **function**
(noun) a piece of code that is not run until it is called. Functions take zero or more arguments. When a function finishes running, it returns a return value back to the code that called it.
*Ex.* <font class="example">I wrote a function that takes an array of numbers as an argument, and returns the average.</font>
* **parameter**
(noun) Synonym for argument.
*Ex.* <font class="example">That function takes two parameters.</font>
* **argument**
(noun) a value that is passed into a function when it is called. Arguments are said to be “passed” into a function, and functions are said to “take” arguments. Also known as a “parameter.”
*Ex.* <font class="example">That function takes two arguments.</font>
* **method**
(noun) a function that is attached to an object. Methods belong to, and are defined in, a class. Also known as a “member function.”
*Ex.* <font class="example">The length method returns the number of characters in a string object.</font>
##### <font class="highlight">If you want to know more, sources are at the bottom.</font>
<br/><br/>
> ###### sources: [Expand Your Programming Vocabulary](https://www.programmingforbeginnersbook.com/blog/expand_your_programming_vocabulary/) | [Oxford Ditionary](https://www.oxfordlearnersdictionaries.com/definition/english/compiler?q=compiler) | WIkipedia
>
> ###### tags: `Python` `beingger` `programming language`