Skip to content

Commit ff86c66

Browse files
committed
initial updates to part 1
1 parent 8757e02 commit ff86c66

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# Python Basics: 0-1 Introduction.
1+
# Python Basics: Introduction.
22

33
This unit provides a basic introduction to Python. By the end of the series, you should be able to:
44

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.
77
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).
1010

11-
12-
# What is Programming
11+
# What is Programming?
1312

1413
> ## Learning Objectives
1514
>
@@ -19,17 +18,17 @@ This unit provides a basic introduction to Python. By the end of the series, you
1918
> * Offer helpful resource websites.
2019
> * Explain how to google an error.
2120
22-
### What it means to "know how to program"
21+
## What it means to "know how to program"
2322

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.
2524

2625
In other words, programming is an extendible skill. Basic programming concepts -- conditionals, for loops, functions -- can be found in almost any programming language.
2726

2827
That being said, programming languages differ from one another in the following ways:
2928

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
3332
4. **Object-oriented:** "objects" are data + functions. Some programming languages are object-oriented (e.g. Python) and some aren't (e.g. C).
3433
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.
3534

@@ -39,15 +38,15 @@ Regardless of what you choose, you will probably grow 'comfortable' in one langu
3938

4039
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.**
4140

42-
### What programming is like
41+
## What programming is like
4342

4443
![xkcd](http://sslimgs.xkcd.com/comics/wisdom_of_the_ancients.png)
4544

4645
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.
4746

4847
If you're a good programmer, you're a good detective!
4948

50-
### Debugging
49+
## Debugging
5150

5251
1. Read the errors!
5352
2. Read the documentation
@@ -56,14 +55,18 @@ If you're a good programmer, you're a good detective!
5655
4. Check your syntax
5756
5. Print statements are your friend
5857

59-
### Googling Errors
58+
## Googling Errors
59+
60+
Here are some tips on how to use Google to resolve errors you run might into:
6061

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!
6364
* See if you can find examples that do and don’t produce the error
6465

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!
6669

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.
6871

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

Comments
 (0)