You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This unit provides a basic introduction to Python. By the end of the series, you should be able to:
4
4
5
-
1. Run Python from the Anaconda Navigator in a Jupyter Notebook
6
-
2. Write basic commands using Python syntax
5
+
1. Run Python from the Anaconda Navigator in a Jupyter Notebook.
6
+
2. Write basic commands using Python syntax.
7
7
3. Grasp the major Python [object](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#object)[types](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#type), including [integers](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#integer), [floats](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#floating-point-number), [strings](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#string), lists, sets, and dictionaries
8
-
4. Operate and manipulate those objects
9
-
5.Integrate choices into your programs using [conditionals](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#conditional-statement)
8
+
4. Operate and manipulate those objects.
9
+
5.Control the flow of your programs using [conditionals](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#conditional-statement).
10
10
11
-
12
-
# What is Programming
11
+
# What is Programming?
13
12
14
13
> ## Learning Objectives
15
14
>
@@ -19,17 +18,17 @@ This unit provides a basic introduction to Python. By the end of the series, you
19
18
> * Offer helpful resource websites.
20
19
> * Explain how to google an error.
21
20
22
-
###What it means to "know how to program"
21
+
## What it means to "know how to program"
23
22
24
-
Most programmers can program in more than one language. That's because they know *how to program* generally, as opposed to "knowing" Python, R, Ruby, or whatever.
23
+
Most programmers can program in more than one language. That's because they know *how to program* generally, as opposed to "knowing" Python, R, Ruby, or any other language.
25
24
26
25
In other words, programming is an extendible skill. Basic programming concepts -- conditionals, for loops, functions -- can be found in almost any programming language.
27
26
28
27
That being said, programming languages differ from one another in the following ways:
29
28
30
-
1.**Syntax**: whether to add a semicolon at the end of each line, etc.
31
-
2.**Usage**: JavaScript is for building websites, R is for statistics, Python is general purpose, etc.
32
-
3.**Level**: how close you are to the hardware. 'C' is often considered to be the lowest (or one of the lowest) level languages.
29
+
1.**Syntax**: The precise rules of how to structure code in a language. For example, whether to add a semicolon at the end of each line.
30
+
2.**Usage**: Different programming languages are designed with different aims in mind. For example, JavaScript is generally for building websites, R is primarily a statistical programming language, Python is a general purpose programming lanaguage, etc.
31
+
3.**Level**: How close you are to the hardware. Programming languages ultimately end up as assembly code or machin 'C' is often considered one of the lowest level programming language in that
33
32
4.**Object-oriented:** "objects" are data + functions. Some programming languages are object-oriented (e.g. Python) and some aren't (e.g. C).
34
33
5.**Many more**: Here's a [list](https://en.wikipedia.org/wiki/List_of_programming_languages_by_type) of all the types of programming languages out there.
35
34
@@ -39,15 +38,15 @@ Regardless of what you choose, you will probably grow 'comfortable' in one langu
39
38
40
39
Thus "knowing how to program" means learning how to *think* like a programmer, not necessarily knowing all the language-specific commands off the top of your head. **Don't learn specific programming languages; learn how to program.**
Here's the sad reality: When you're programming, 80% or more of your time will be spent debugging, looking stuff up (like program-specific syntax, [documentation](https://github.com/dlab-berkeley/python-intensive/blob/master/Glossary.md#documentation) for packages, useful functions, etc.), or testing. This does not just apply to beginner or intermediate programmers, although you will grow more "fluent" over time.
47
46
48
47
If you're a good programmer, you're a good detective!
49
48
50
-
###Debugging
49
+
## Debugging
51
50
52
51
1. Read the errors!
53
52
2. Read the documentation
@@ -56,14 +55,18 @@ If you're a good programmer, you're a good detective!
56
55
4. Check your syntax
57
56
5. Print statements are your friend
58
57
59
-
### Googling Errors
58
+
## Googling Errors
59
+
60
+
Here are some tips on how to use Google to resolve errors you run might into:
60
61
61
-
*google: name-of-program + text in error message
62
-
*Remove user- and data-specific information first!
62
+
*Enter in Google the name of the computer language and the text in error message.
63
+
*Be sure to remove user- and data-specific information first!
63
64
* See if you can find examples that do and don’t produce the error
64
65
65
-
### Stack Overflow Example
66
+
## Stack Overflow Example
67
+
68
+
Often when you Google something, the most relevant and helpful result will be someone asking a similar question on StackOverflow. Just to give you an example of what this looks like, [this](https://stackoverflow.com/questions/1228299/change-one-character-in-a-string) is one of the top results if you Google "python change one character in a string". When we talk about strings and lists, you'll see why this might be a question you have!
66
69
67
-
Often when you google something, the most relevant and helpful result will be someone asking a similar question on Stack Overflow. Just to give you an example of what this looks like, [this](https://stackoverflow.com/questions/1228299/change-one-character-in-a-string) is the first result if you google "python change one character in a string". When we talk about strings and lists, you'll see why this might be a question you have!
70
+
StackOverflow is a great resource by which people can ask and answer questions. In the above case, there's a lot of different answers to the question -- some more detailed than others -- and you can go with the approach that works best for you.
68
71
69
-
You'll see that someone asks a question, with an example of their question or problem, and then other users respond. If you look carefully, you'll see that some answers are more detailed than others, and that there is more than one way to go about doing something.
72
+
Don't reinvent the wheel -- learning how to find the answer to the issues you run into is a critical part of becoming a capable programmer!
0 commit comments