Skip to content
Permalink
Browse files
resolved stashed issues and cleaned master.
  • Loading branch information
Barnsa committed Jul 23, 2020
1 parent 689d0e0 commit 1c275e3aa32edd06f221563284b628c38bd6c890
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
@@ -1,6 +1,9 @@
{
"cSpell.words": [
<<<<<<< Updated upstream
"adzyb",
=======
>>>>>>> Stashed changes
"decrement",
"iterable",
"pythonic"
@@ -147,5 +147,9 @@ All logic inside a computer boils down to True or False logic. True is either re

When considering your if statements, you need to consider how they will be evaluated. Consider this code fragment:

<<<<<<< Updated upstream
{{ code_from_file("conditionals/example-5.py", 1, 40, execute=True) }}

=======
{{ code_from_file("conditionals/example-5.py", 1, 40, execute=True) }}
>>>>>>> Stashed changes
@@ -1,6 +1,5 @@
# While Loops (indefinite iteration)


Anytime you want to do anything more than once in a Python program, you should consider putting it inside a loop.
There are two types of loops in python, a 'for' loop and a 'while' loop. Generally 'for' loops are used when you know the amount of times you want to repeat something. It doesn't have to be an exact integer value, it can also be anything easily calculable. 'While' loops are used when you aren't sure how many times you need to repeat something or you need to do something recursively.
In python, all control statements use indentation to define blocks of grouped code.
@@ -6,10 +6,7 @@
There are 4 basic types in python; Boolean, integer, floating point number and string. Booleans or "bools" are either true or false, a one or a zero, they are representative of the binary calculations that make computers work. Integers are any whole number and can be both positive and negative numbers, where as floating point numbers are anything with a decimal point in. A string is an interesting type as it also works like an iterable which we'll see more of later, but it stores a string of characters together. Every time we make a value that a computer needs to be able to reuse, we call that type a "variable". Let's look at some examples of how we use types and make variables:

## Basic Types: Creating your first variable
To create your first variable it's pretty easy, you just name it and then use the assignment operator to assign it to that name. This will create a sort of pet name, pseudonym, or alias for a location in memory where the object that contains the value is then stored. Anytime you use that pseudonym it'll refer to whatever is stored in that object again. It's easier to show you then it is to explain it. In the next few examples you'll see how to create and label a variable in python. The two things you need to keep in mind when creating a variable are; an appropriate name/label, and the type of variable you need to create.

!!! Warning
Variables are the fundamentals of programming and are included everywhere, so make sure you feel comfortable with everything here before you move on to other sections.
To create your first variable it's pretty easy, you just name it and then use the assignment operator to assign it to that name. This will create a sort of pet name, pseudonym, or alias for a location in memory where the object that contains the value is then stored. Anytime you use that pseudonym it'll refer to whatever is stored in that object again. It's easier to show you then it is to explain it, so make sure you feel comfortable with everything here before you move on. In the next few examples you'll see how to create and label a variable in python. The two things you need to keep in mind when creating a variable are; an appropriate name/label, and the type of variable you need to create.

### Naming Conventions
Variable names can start with a number, letter, or underscore, but not any other special character. [PEP8](https://www.python.org/dev/peps/pep-0008/) Python programming conventions say that variables should be named with all lower case letters, for longer variable names each word should be separated by underscores:

0 comments on commit 1c275e3

Please sign in to comment.