Python Introduction

What is Python?

Python Logo

A powerful, yet easy to use, programming language.

Python is one of the most popular general-purpose programming languages, used by many developers to write software of varying complexity and purpose. It’s known for having very natural, English-like syntax, making it easy to pick up for newcomers.

Why Code in Python?

Python fulfills AguaClara’s devotion to open source technology.

AguaClara is making the switch from Mathcad to Python in order to keep up with the times and stay true to our open-source philosophy.

Learning Python

It’s okay to feel uncomfortable around a new programming language!

As long as you’ve learned how to program before in MATLAB, Java, or any other language, there’s very little difference in the overall programming mindset. The only differences that you might find are little nuances in syntax.

Debugging

If you run into any errors or bugs while writing Python code, follow these general steps to resolve them:

  1. Read the error message. Error messages give very valuable information on how to solve code problems - don’t ignore them! Many times, they’ll tell you exactly how to fix your code.

  2. Look for your error in Common Errors in Python.

  3. Search for a solution online. It’s very likely that someone else has experienced the same problem that you’re facing, and discussed it online. Try searching for both

    • The error message

    • What you’re trying to do with the code

  4. Ask someone for help. Sometimes you may not find the answer online - ask your subteam lead, RA, or someone on Apps & Algorithms for help. Better yet, open an issue on Github or a question on Stack Overflow so that more people can see it and try to figure it out.

External Resources

Apart from these tutorials, there are a number of great resources to learn more about coding in Python on the Internet:

  • CS 1110 posts lectures on its website here.

    • You can also learn about general programming using Python by enrolling in CS 1133, which is 2 credits S/U and covers the basics of the language.

  • Learn X in Y minutes: Python is the fastest way to get a basic understanding of Python syntax.

  • Code Academy and Learn Python have great interactive tutorials to learn how to code in Python.

  • Stack Overflow is a community-based website that has millions of questions and answers related to coding.