Log in and enrol
Python Programming Fundamentals
Python Programming Fundamentals
Learn to program in Python from scratch: syntax, control flow, functions, data structures, files and errors, up to small programs that are well organized, tested and readable.
Course description
The course is the first of the Python Programming Trilogy and takes learners who have never programmed to the point of writing small, complete and well-organised Python programs. It starts with setting up the working environment and the basic syntax, then moves on to control flow with conditions and loops, functions and the core data structures (lists, tuples, dictionaries and sets), reading and writing files, and handling exceptions and bugs. The final week introduces the good practices that make code reusable and reliable: modules, project structure, testing, the standard library, readability and planning before writing code. Each week ends with a guided case study that brings together what has been learned in a realistic program.
Total workload of the course: 200 hours
This MOOC was produced as part of the Edvance project – Digital Education Hub per la Cultura Digitale Avanzata. The project is funded by the European Union – Next Generation EU, Component 1, Investment 3.4 “Didattica e competenze universitarie avanzate".



Intended Learning Outcomes
By the end of the course, learners will be able to:
- Install and configure a Python working environment (interpreter, editor, Jupyter notebooks) and run scripts and code cells
- Write expressions, use variables and data types, manipulate strings and handle input and formatted output
- Control program flow with conditions and for and while loops, recognising common mistakes such as infinite loops and off-by-one errors
- Design reusable functions with parameters, default values and return values, correctly applying variable scope rules
- Choose and combine lists, tuples, dictionaries and sets according to order, mutability, uniqueness and access method
- Read, process, validate and write text, CSV and log files, cleaning the data before using it
- Interpret tracebacks and exceptions, handle expected errors with try/except and apply systematic debugging strategies
- Organise a small project into modules and folders, check its behaviour with assert-based tests and use standard-library modules
- Plan a program from a problem description and write readable, documented code, integrating the skills of the course into a complete application
Prerequisites
- No prior programming knowledge is required: the course starts from installing Python and introduces every concept from scratch;
- Basic computer literacy (managing files and folders, installing software);
- A good understanding of written and spoken English, as the course is delivered in English.
Activities
- Video lessons (33 videos, some lessons in two parts) with full transcripts;
- Python (Jupyter) notebooks with the code and exercises for each lesson;
- Four guided case studies: summarising and validating a class's grades, managing course enrolments and grades, cleaning a website access log, and a personal reading tracker;
- Supplementary readings and videos for each week;
- Weekly assessment quizzes: one per week, with 10 multiple-choice questions and feedback.
Section outline
-
-
-
Getting Started with Python: setting up the working environment (Python, editor, Jupyter), expressions, variables and types, strings and input/output, conditions and Boolean logic, for and while loops; case study on summarising and validating a class's grades.
-
Functions and Data Structures: defining functions, parameters and return values, variable scope and default arguments, lists, tuples, dictionaries and sets, combining data structures; case study on managing course enrolments and grades.
-
Working with Files and Errors: reading and writing text files, processing CSV files and logs, exceptions and tracebacks, error handling with try/except, debugging strategies, data cleaning; case study on cleaning a website access log.
-
Organizing, Testing, and Writing Readable Programs: modules and imports, project structure, testing with assert, the standard library (math, random, datetime, pathlib), code style, naming and documentation, planning before coding; final case study: a personal reading tracker.
-
-
Video transcripts Folder
-
Assessment
Your final grade for the course will be based on the results of your answers to the assessed quizzes. You have an unlimited number of attempts at each quiz, but you must wait 15 minutes before you can try again. You will have successfully completed the course if you score 60% (or higher) in each one of the assessed quizzes. The maximum score possible for each quiz is given at the beginning of the quiz. You can view your score in the quiz on your last attempt or on the 'Grades' page.
Certificate
You can achieve a certificate in the form of an Open Badge for this course, if you reach at least 60% of the total score in each one of the assessed quizzes and fill in the final survey.
Once you have completed the required tasks, you will be able to access ‘Get the Open Badge’ and start issuing the badge. Instructions on how to access the badge will be sent to your e-mail address.
The Badge does not confer any academic credit, grade or degree.
Information about fees and access to materials
The course is delivered in online mode and is available free of charge.
Course faculty

Giacomo Fiumara
Teacher
Contact details
If you have any enquiries about the course or if you need technical assistance please contact pok@polimi.it. For further information, see FAQ page.