Introduction to computer programming
|
Goals | Program | Teaching resources |
Lectures timetable | Office hours | Exams |
Lectures, with content details |
For comments, please contact the teacher at
paoloA_DOT_HEREfranciosaAT_SYMBOLuniroma1A_DOT_HEREit
The main goal of the course is to introduce students to computer programming, giving basic skills in Python programming language.
At the end of the course the students will be able to solve simple problems by coding an algorithm in Python, using a user friendly IDE.
A tutorial on Python programming tools http://www.allendowney.com/wp/books/think-python-2e/
The exam consists of a practical programming test in Python to be taken on the computer in the same way as during the lab exercises. The test will be followed by a possible interview at the discretion of the teacher.
It is recommended to practice the test as described during the laboratory lectures. The test will be taken in via Tiburtina labs on the DSS virtual machine. It is recommended to practice using this machine by downloading the virtual machine as described above. Only the synoptic table available here in PDF version can be used during the programming test.
Register to December 15, 2023, exam test
More exercises are available here
For comments, please contact the teacher at
paoloA_DOT_HEREfranciosaAT_SYMBOLuniroma1A_DOT_HEREit
September 29, 2023 | |
---|---|
Topics |
|
Material |
A recording of September 29, 2023 lesson is available at
this Zoom link Passcode: =68MA#&7 |
October 6, 2023 | |
---|---|
Topics |
Calling methods and using the returned value Defining methods: the Generating pseudo-random numbers with Simple programs with Conditional statement Relational operators |
Lab activity | |
Material |
A recording of October 6, 2023 lesson is available at
this Zoom link Passcode: zt32&?EE |
Sources and exercises |
|
October 13, 2023 | |
---|---|
Topics |
Activation record stack. Local variables.
Parameter passing. Absence of side effects on simple (immutable) parameters. Cycle statement Exercises on cycles and conditional statements |
Lab activity | |
Material |
A recording of October 13, 2023 lesson is available at the following links:
These recordings are for personal use only, and are reserved to Sapienza students. Dissemination of these links to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
|
October 20, 2023 | |
---|---|
Topics |
Sequences
Using Simple programs with |
Material |
A recording of October 13, 2023 lesson is available at this Zoom link Passcode: !9RMe8mD This recording is for personal use only, and is reserved to Sapienza students. Dissemination of this link to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
Pytagoric triplesWrite a program that given a natural number For 3^2 + 4^2 = 5^2 5^2 + 12^2 = 13^2 6^2 + 8^2 = 10^2 8^2 + 15^2 = 17^2 9^2 + 12^2 = 15^2 12^2 + 16^2 = 20^2 Solution: cercaTernePitagoriche.py Function that, given two lists a, b of numbers with the same length,
returns the scalar product print(scalar([1, 4, 3, 0], [3, 0, 5, 5])) should give 18 Function that, given a list, returns Function that, given a natural n, returns the list containing
the first n elements of the Fibonacci sequence. s = fibonacci(10) print(s) gives [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] Function that, given two lists a, b of numbers with the same length,
returns the sum of the lists, i.e., a list c of the same length
such that c_i = a_i + b_i Function that, given a list x, separate elements larger that the average from elements smaller or equal to the average def separate(seq): small = [] large = [] ...... .... here you append to small or to large return small, large x = [..., ... , .] s, l = separate(x) print(s, l) |
October 27, 2023 | |
---|---|
Topics |
List parameters can be modified by a function Exercises on lists and cycles. Slicing, methods available in class |
Material |
A recording of October 27, 2023 lesson is available at this Zoom link Passcode: kh28cRA^ This recording is for personal use only, and is reserved to Sapienza students. Dissemination of this link to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
Solutions are proposed in solutionsActivity5.zip |
November 10, 2023 | |
---|---|
Topics |
List comprehension Lists of lists (matrices) Exercises on lists of lists |
Material |
A recording of November 10, 2023 lesson is available at this Zoom link Passcode: .Q^hTL9* This recording is for personal use only, and is reserved to Sapienza students. Dissemination of this link to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
Solutions are proposed in solutionsActivity6.zip |
November 17, 2023 | |
---|---|
Topics |
Dictionaries. Accessing and adding pairs Scanning dictionaries keys. Getting keys and values by Compute frequencies from a list |
Material |
A recording of November 17, 2023 lesson is available at this Zoom link Passcode: #Y^95F?M This recording is for personal use only, and is reserved to Sapienza students. Dissemination of this link to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
Solutions are proposed in solutionsActivity7.zip |
December 1, 2023 | |
---|---|
Topics |
Reading and writing text files ASCII and UNICODE coding, UTF-8 representation Opening a text file by Writing by Reading lines by The |
Material |
A recording of November 1, 2023 lesson is available at this Zoom link Passcode: 8ev1S.b+ Due to technical reasons, audio has only been recorded for the initial part of the lesson. This recording is for personal use only, and is reserved to Sapienza students. Dissemination of this link to persons outside the Statistics degree and master degree programs of Sapienza is not allowed. |
Sources and exercises |
|
December 15, 2023 | |
---|---|
Exam test will be given on December 15, 2023, in via Tiburtina 205, room 15. More exercises are available here |