Success Tips and Resources

Getting Started

Haven’t touched Python before? No problem! Here’s a suggested sequence to get started:

  1. Start with Hedy, a very gentle introduction to Python programming.
  2. Then go through futurecoder.
  3. Then do Kaggle’s Python and pandas tutorials.

How to Succeed in This Class

A word to the wise: Starting early is essential to success in programming. Newcomers sometimes think that they can start an assignment at the last minute and do reasonably well. Programming isn’t like writing a paper, where you can have partially developed arguments and missing information but still have something to submit. In programming, it often either works or it doesn’t. Most programming problems at this level require several rounds of trying and taking a break.

Extra Practice

If you want more practice, here are some suggestions:

  1. Do the “Challenge” exercises in the textbook.
  2. Work through some Python practice problems.
  3. Here’s some more Python practice problems that I’m working on writing.
  4. Search for “Python practice” on your favorite search engine.

Patterns

Gather, compute, use. Example:

# Gather
n = int(input("Enter a number: "))
# Compute
result = n * 2
# Use
print("Twice", n, "is", result)

Problem-Solving Strategies

Once, twice, many

A loop-writing strategy.

Example: Sum the numbers in a list.

Once: Write a program that sums the numbers in a list of length 1.

numbers = [5]
total = numbers[0]
print("The sum is", total)

Twice: Extend the program so that it sums the numbers in a list of length 2.

numbers = [5, 7]
total = numbers[0] + numbers[1]
print("The sum is", total)

Many: First, adapt the code so that “twice” is two copies of exactly the same lines of code.

numbers = [5, 7]
total = 0
total = total + numbers[0]
total = total + numbers[1]
print("The sum is", total)

Then, surround that code with a loop that repeats the code as many times as needed.

numbers = [5, 7, 3, 8]
total = 0
for n in numbers:
    total = total + n
print("The sum is", total)

Other Resources

Tools

Other interesting things