¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

python; strings and variables

emily ! Computing Year 8 Inglés

Contenido del mapa

python; strings and variables

  1. variable is a letter- stores temporary values, may be a place or location

    • variable may only contain letters, numbers or underscores (such as _ ) but cannot start with a number
  2. python is a programming language

    • code tries to solve a problem, by breaking things into smaller, simpler steps / tasks
      • known as decomposition
        • in general coding language, not just python
      • ordered, small steps are known as an algorithm (like instructions)
      • a sequence is an order in which a computer solves a problem, using an algorithm
        • the algorithm's instructions must be clearly defined and in the correct order (it must not miss any steps, such as going from step 1 to 3)
  3. syntax errors are errors that occur due to typing incorrectly

    • for example, print "hello world" is wrong because there are no brackets
      • the correct way to type this is print ("hello world")
      • you may use single or double quotations
  4. IDLE- integrated development environment

    • there are two modes:
      • interactive, allows you to see your results as you type
      • script mode; you must save and run the code to see your results
  5. comments are in Python

    • to make a comment, you must put * around the comment
    • comments help the programmer or anyone reading the code. It allows someone, at a later date than the code was created, to understand what the programmer was trying to do
    • the comment does not affect the actual code or the results
  6. all functions in Python are in purple

    • functions include input () and print
    • functions are special built-in routines that do a specific job
  7. strings represent uncoded characters; they must be two or more characters

  8. a = 'hello' ; print () (an example of variable usage, ; represents next line)

  9. an integer is a variable, letters are strings

    • a decimal is called a float
  10. an array can be seen as a list

    • strings in Python are arrays of bytes representing characters
    • len () refers to the length of the string
      • for example, a = hello world
        • print (len(a))
          • the number 11 will come up, because there are 11 characters in 'hello world'
  11. to write three quotes in one go, you must use three sets of quotation marks

  12. square brackets are used to access certain parts of the string

    • for example; a = abcdefghijklmnopqrstuvwxyz
      • print (a [2])
        • this would print b, the second element of the string, represented by the number 2 in the square brackets
          • print (a [2:5] would mean print letters 2 to 5, not including 2
            • so this command would print 'cde'
            • print (a [-5:-2]) would be the same, but starting from the end of the string

Información

Descripción
Year 8 Computing Mapa Mental sobre python; strings and variables, creado por emily ! el 04/12/2019.
Creado por
emily !
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?