Module 1: Introduction to Python

In this module, you will learn how to write basic Python code. Make sure that you go through the material provided in the links before attempting the exercises. You have two solutions to attempt the exercise (1) Write directly into the console and click `run code`. You will be told whether your get the correct answer. If stuck, you can ask for a hint or show the solution. Note that the first time you do this, a cloud server will be set up and it may take some time. Also do not navigate away from the code block (e.g., by opening another exercise) as this will stop the execution. (2) Attempt this on your local machine and use the Show solution tab to verify that you did the exercise correctly. You can also use the hints to help you if you choose to run locally.

1Why Python?

2Getting Started with Python

3Numbers

4Logic

5Variables

6Words and Letters

7Storing collection of data: lists, tuples, sets, and dictionaries

8Conditionals

9Loops

10Functions

11Classes/Objects

12Additional resources

About this course

This is a free, open source course on how to use different Data Science Techniques and Tools to make your science FAIR. It is made possible by a grant from the National Science Foundation RISE2324732. Contributions and comments on how to improve the course are welcome! To file an issue go to: https://github.com/LinkedEarth/LeapFROGS/issues

About me

The sharing of open source data, code, and workflows is fundamental to the building of a FAIR (Findable, Accessible, Interoperable, and Reusable) research ecosystem. Open source tools allow for a community to come together and contribute to the development and improvement of research infrastructure. Such collaborations lead to more robust and efficient solutions, as well as increased transparency and accessibility.The geoscience community is only now beginning to harness the power of the open source model, and formal training on the benefits and proper use of this model is still missing from most geoscience curricula. While computer science courses may provide some level of training, the technical details often do not align with the specific needs of geoscientists. Our objective is to build human infrastructure to promote reproducible and transparent geoscience by educating geoscientists on the effective utilization of open source resources through practical applications in their own scientific research.