Stuff

Páginas: 3 (593 palabras) Publicado: 10 de diciembre de 2012
Python Notes Lesson 2: (Very Simple Programs)

+ addition
/ division
- substraction
* multiplication
% remainder
** exponent
# (hash) comments not included in program
print"...." (output iswhatever in between "_")

Python Notes Lesson 3: (Variables and Scripts)

In the 'print' command, the comma outside the inverted commas(“_”) stops the program from starting a new line on thescreen when showing text
Variable can be used and store values.
You can put more than numbers in variables, you can hold things such as text. Variables that hold text are called strings. Strings can alsobe added to make longer works or sentences

Python Notes Lesson 4: (Loops and Conditionals)

The 'while' loop is a loop which performs loops until not possible
Ex:
a = 0
while a < 10:
a =a + 1
print a
Boolean Expressions just means a question that can be answered with a TRUE or FALSE response. A loop thinks-if the expression is true, keep looping. If it is false don't loop
<less than
<= Less than or equal to
> greater than
>= greater than or equal to
!= not equal to
<> not equal to (alternate)
== equal to
Attention: Don't get '=' confused with '=='.the '=' operator makes what is on the left equal to what is the right. The '==' operator says whether the thing on the left is the same as what is on the right, and returns true or false
ConditionalStatements are where a section of code is only run if certain conditions are met. The most common conditional is the 'if' statement which is: conditions to be met, then do this, then and this, then andthis, then but this happens regardless, finally because it isn't intended
There is also 'else' statement and 'elif' statement. The 'else' statement simply tells the computer what to do if theconditions of 'if' aren't met. The 'elif' statement is just a shortened way of saying 'else if'. When the 'if' statement fails to be true, 'elif' will do what is under it IF the conditions are met.
One...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Stuff
  • Stuff
  • stuff
  • Stuff
  • Stuff.
  • stuff
  • stuff
  • My stuff

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS