Citing code
The Internet is a great place to find help with coding problems, and there is nothing wrong with using Google to help get you through a problem set. Everyone does it.
It is important, however, to give credit where credit is due. Writing code is like writing a research paper. If you are using someone else's ideas (functions, algorithms, blocks of code), you need to cite them.
To cite code, add a comment in your code that lists the url and the date you retrieved the code. If you have modified the code, say so.
If you are doing something very common, and just need a quick refresher on the function, or what order to pass the arguments, then you do not need to cite your source.
When in doubt, cite.
Don't copy what you don't understand.
Even if you properly cite your sources, you should not copy code that you do not understand. Our goal is to learn how to write code, and blindly copying defeats the purpose. It also makes it hard to troubleshoot your code and can lead to unexpected results. You don't want to end up like this developer.
For this class, a good approach is to look at the source online and then write your own code, rather than copy and paste. You are much more likely to internalize the idea if you have to code it yourself. It also gives you an opportunity to choose variable names and to structure the code in your style.