Masters in Data Science applied to agricultural and food sciences, environment, and forestry engineering.
Instructor: Manuel Campagnolo (mlc@isa.ulisboa.pt)
Teaching assistant: Hannah Nathanson (hnathanson@edu.ulisboa.pt)
Revised class schedule: class (Friday, room 48) will start at 11:45 and end at 14:45, with a ~45 minute break for lunch.
Please fill the course diagnostic form at https://forms.gle/VMK681TQ3LMXZqWU8
* You need to self-register for the course in Moodle at <https://elearning.ulisboa.pt/user/index.php?id=12863>. The Moodle site allows you to access assignments; submissions; detailed grades and comments * If you don't have one already, create a GitHub account at <https://github.com/signup> * [CS50P: CS50’s Introduction to Programming with Python](https://cs50.harvard.edu/python). Lectures (videos and notes), problems sets, shorts; * [CS50 codespace](https://cs50.dev/). VScode codespace that allows you to use a customized AI bot (CS50's duck debugger, or DDB for short) and test your solutions for CS50P proposed problems (you can access the codespace with your GitHub user). * [Python tutor](https://pythontutor.com/). Python Tutor is a online tool that lets you write code in a web browser and see what happens step-by-step as the computer runs it. * [Fenix webpage for the course](https://fenix.isa.ulisboa.pt/courses/intpy-564938523285845): administrative information and final grades
* [Learn Python with Scrimba, Olof Paulson](https://v2.scrimba.com/learn-python-c03): interactive lectures (videos), examples and exercises * [Introduction to Python (VScode)](https://vscodeedu.com/courses/intro-to-python): interactive step by step lectures and exercises, real-time quizzes. * Basic concepts and features of the Python language and system: [The Python Tutorial at python.org](https://docs.python.org/3/tutorial/index.html). * Python Programming course at [PP.fi](https://programming-25.mooc.fi/): same features as CS50 but to test your solutions to problems you are required to pass previous tests * If you curious about the story of Python, check out [this video](https://www.youtube.com/watch?v=GfH4QL4VqJ0). In this video, you'll learn about the output of `>>> import this` and many other anecdotes about Python.
code filename.py to create a new filels to list files in foldercp filename newfilename to copy a file, e.g. cp ..\hello.py farewell.py (.. represents parent folder)mv filename newfilename to rename or move file, e.g. my farewell.py goodbye.py or mv farewell.py .. (move one folder up)rm filename to delete (remove) filemkdir foldername to create new foldercd foldername change directory, e.g. cd ..rmdir foldername to delete folderclear to clear terminal windowpython gives you access to a REPL (interactive Read-Eval-Print-Loop) environment (https://realpython.com/interacting-with-python/).list, tuple, set and dictionary.
str), variables, print (a function), parameters (e.g. end=), input, comments, formatted strings (f"..."), .strip(), .title (methods)int), operations for integers, casting (e.g. str to int)float), round, format floats (e.g. f"{z:.2f})True, False, that can be combined with operators and, or, notdef, return. Example:
def square(x):
return x*x
View the step-by-step execution of this code on Python Tutor. Identify the scope of the variables. Try to add print(s) in line 4 after calling function square inside the main function: why do you get a NameError?