Tutorials in Quantitative Methods for Psychology (Mar 2021)
Introduction to Python's Syntax
Abstract
This tutorial is the second in our series and covers basic syntax in Python with examples related to psychology. The aim is to teach programming beginners and experts alike the fundamentals required in order to smooth the learning curve and succeed with integrating Python with their research. It starts by covering basic built-in functions and variable creation. Next, different data types and data structures that you will encounter are covered detail, followed by comments and best commenting practices. Finally, indentation, logic, conditional statements, and loops are all explained with simple, illustrative examples. The tutorial ends with a comprehensive example of the same-different task from cognition that ties together everything learned. With this foundation, the reader will gain the confidence to begin practicing Python on their own and think of ways to incorporate it into their own research and daily lives.
Keywords