Think Python

tsilvo2001
Mind Map by , created almost 4 years ago

A mind map of chapter 1 in the Green tea press "Think Python"

199
16
0
Tags
tsilvo2001
Created by tsilvo2001 almost 4 years ago
Python Appendix A - ex.1
Melissa Machado
computer systems and programming quiz
Molly Batch
Computer Systems
lisawinkler10
Notes - Managing change in human environments
chrislmurray2014
Core 1.12 Timbers blank test
T Andrews
Python Quiz
karljmurphy
What is Python?
Daniel Ingram
Python
54671
Basic Python - Strings
Rebecca Noel
Think Python
1 Green Tea Press Chapter 1
1.1 1.1
1.1.1 Interpreters and Compilers
1.1.1.1 These are both ways of translating High level languages into lower level ones
1.1.1.1.1 A compiler checks and translates the whole of the source code before running the program
1.1.1.1.2 An interpreter translates and executes the souce code a chunk at a time. It translates a line then runs it
1.1.1.1.2.1 Example
1.1.1.1.2.1.1 Python is an iterpreted language because it is executed by an interpreter
1.1.1.1.2.1.1.1 There are two ways to use this interpreter: Interactive mode and Script mode. Interactive mode is on the initail window marked by >>> which is a direct way to execute code >>> 2+2 and python will respond on the next line with >>> 4 . Script mode needs a new window opened and is used for larger and more demanding scripts like a full game or etcha-sketch
1.1.2 High Level and low level programs
1.1.2.1 Higher level programs are able to work on a variety of computers with very little tweaking
1.1.2.1.1 Python is a high level program so the computer has to go through it before it runs. Other examples are Java and C++
1.1.2.2 Low level programs don't need translating
1.2 1.2
1.2.1 What is a program?
1.2.1.1 A program is a set of instructions that says how to perform a computation
1.2.1.1.1 The details vary per specific language but same basic principals remain. These are what a program is translated into, it doesn't matter how complicated it may be
1.2.1.1.1.1 Input: Gathering data from a keyboard, mic or other device
1.2.1.1.1.2 Output: Displaying the data on a screen or other device
1.2.1.1.1.3 Math: Simple addition, subtraction etc
1.2.1.1.1.4 Conditional execution: Looking for the IFs and BUTs within a program and following them
1.2.1.1.1.5 Repetition: Repeating an action. sometimes with slight variations
1.3 1.3
1.3.1 Debugging
1.3.1.1 Debugging is the process of finding and correcting errors in you program
1.3.1.1.1 There are 3 types of error
1.3.1.1.1.1 Syntax Error
1.3.1.1.1.1.1 A syntax error is an error with the rules of a structure: (2+2) is legal, but 2+2) is not because brackets always come in pairs
1.3.1.1.1.2 Runtime Error
1.3.1.1.1.2.1 Runtime error is an error that occurs after the program has started running
1.3.1.1.1.3 Semantic Error
1.3.1.1.1.3.1 A semantic error is not a problem with how you composed the program's structure it is a problem with what you wanted the program to do: so you wanted to print "Hello" but you typed print "Helo" instead that would be a semantic error
1.4 1.4
1.4.1 Language types
1.4.1.1 Formal
1.4.1.1.1 These were created to express a point in a clear and easily understood way
1.4.1.1.1.1 Examples of this are mathematical notation and chemical short hand
1.4.1.1.1.1.1 Maths has basic syntax rules: 2+2 = 4 is correct but 3+=4(0 isn't
1.4.1.1.1.1.2 Chemical short hand also has basic syntax rules: CO is the short hand for carbon monoxide but Zz doesn't work as there is no element with the short hand of Zz
1.4.1.2 Natural
1.4.1.2.1 These are languages like English, German and French, they have evolved over time, they were NOT created over night or by one specific person
1.5 1.5
1.5.1 The first program
1.5.1.1 The traditional first program you should write is, in python: print "Hello, World" , this is a print statement meaning it will show Hello, World on the screen. the " in the program defines what will be displayed and the print is the output method
1.6 1.6
1.6.1 Treating the computer right
1.6.1.1 Many people treat a computer as though it was a real person, getting angry at it when it points out the smallest fault and viewing it as a teammate when it all seems to be going well.
1.6.1.1.1 The best way to view a computer is to see it as a fellow student that has certain strengths and weaknesses: it is efficient, fast and hard working but it is pedantic and narrow minded. try to use the advantages and work around the weaknesses to get the best from your computer

Media attachments