I'm sorry if this question is kind of lame.
I'm new to programming environment. Recently I've learned python, and currently working on image viewer project using pygtk. While coding I had to imitate codes from examples in tutorial and other people's projects to get things done. Does doing so can be considered as plagiarism? Can I claim that the code is mine though there are some similarities in some part of the codes. But I can claim that no complete copy/paste process was involved while writing the code, it's just imitating the way things are done.