Growth Mindset: Algorithmic Thinking and Coding (code 27233B)

Lecturer: Dr. Paolo Coletti . Office E203 - Office hours:


Scope of this course

  1. Give you a highly requested skill which can enlight your résumé in case you decide (or are forced to) not to become an entrepreneur and apply for a job.
  2. Open your mind towards a problem solving attitude together with the other module Design Thinking. Clearly each module will show you a completely different aspect of problem solving.
  3. Give you a strong background knowledge over programming techniques and strategy, obviously not to become a programmer yourself but to be able to talk with your developers and arrange with them precise plans without accepting passively developers' decisions.


In order to correctly follow this course each student is required previous knowledge on these topics:

Course content

How to study for this course

This course is different from the majority of courses you are used to. This course is much more technical than theoretical and it is strictly sequential. This means that you have to adapt your study strategy. First of all, you either attend all the lessons (or compensate for missing lessons watching immediately the corresponding videos or reading the book) or it is really not worth coming to the next one, since you will have a hard life understanding the next topic. Moreover, after each lesson you must repeat slowly on your own everything done in class in order to be sure to have fully grasped the explained concepts before the next lesson. And, needless to say it, do the exercise without copying them from your colleagues. Some students who had severe problems with this course in the previous years found out that watching the YouTube video BEFORE the lesson is a big help in understanding the lesson.

For the exam the main difference with respect to other courses is that you have to train much more than studying. The content of this course is easy and does not need extensive study, however it is only with practice that you become skilled enough and know immediately what to do without wasting time.


Exam is split in three parts. The grade is the weighted average of the three parts, based on how many lessons were dedicated to each of them.

  1. Questions and exercises on computational complexity (on paper closed books, no material), worth 17/36
  2. Practical exercises on Python (on computer, fully open book), worth 17/36
  3. Theoretical questions on cryptocurrencies and blockchain technology (on paper closed books, no material), worth 2/36


Students have the opportunity to skip parts 1 and 2 of the exam with mid-terms. Each part is completely independent and will let you skip that part of exam. The mid-term grade will be your grade at the exam. If you believe that a grade in a certain mid-term is too low for you, write an email to dr. Coletti at least 7 days before the exam and you will be able to do the exam on that part.

In order to be allowed to participate in the mid-terms you must submit all the home exercises that are assigned after each lesson by email to not later than 24 hours before the next lesson. You can do them alone or in a group of two, but your partner may not be the same of the previous homework. If they are not done properly or contain severe mistakes, you will receive immediate feedback from dr. Coletti. If you submit them early and not at the last minute and they are not sufficient, you can get the possibility to redo them after the feedback. Home exercises will be evaluated and you need to do them in a decent way to be allowed to participate in the mid-term, even though the home exercises grade will not be considered for your exam's grade.

Do not:
- search with Google and come up with a solution which uses techniques and tools not explained in class. All exercises are designed to be solved with what is explained in class and you cannot use other tools to make your job easier, it is not useful for you;
- copy the assignment from your colleagues (excluding obviously the colleague with whom you are working, if you chose to work as a group). I will have to inform the Dean if this happens (yes, in the past it happened...);
- send your code to your colleagues. It is fine to help other students and even to work together in more than two, but each group has his/her own code. If you send your code around, for sure somebody will send it to me very similar and I will inform the Dean (yes, in the past it happened...);
- send the assignment to me without specifying that you worked in a group with another person. It is not possible to attach a person after you have submitted (yes, in the past somebody tried it...)

Note that all students have this possibility, regardless of whether they attend or not. However, at the beginning of each lesson we will discuss together the home exercises and your problems and thus being present has its advantages for your comprehension and you can get extra points for course's improvements and good suggestions.

Modifications due to Covid

Attending the course

If you attend the course online, it will be very difficult to watch what I am doing and at the same time do it yourself. The best solution is having two screens: on the former you watch my video and on the latter you repeat what I do. You can use also your home television as second screen. Check which ports does your computer have (probably HDMI, USB Type C, DisplayPort, VGA; search on Google for their pictures) and which ports does your television or secon monitor has. A connection cable among two ports is cheap. Alternatively you can watch my video on a tablet or an old computer or a smartphone and use your main computer to repeat my examples.

Python practical part

I will send you the file via email and receive the file back via email.

In this video you find instructions on how to install and configure OBS, a program that you can use to record your screen and your face at the same time. Installing the program, configuring, making it work properly and have enough space on your disk (estimation: 200 MB for the program, 200 MB for each hour of exam) is your responsibility, so do at least a recording test of 30 minutes. Have Teams switched off when you use OBS, you must start the recording BEFORE receiving the exam files and end it AFTER sending the exam files to me: I must be able to see you opening the email and see you sending the email back to me. After the recording has stopped, please rename the video with your surname and then send it to me via WeTransfer or any other similar website that you like (which does not force me to register, so NO Google Drive). Do not delete it until I have published the grades. My copy of the video will be deleted as soon as I correct that part of the exam.

In case during the exam you need my assistance and would like to call me on Teams, you will not be able to make a video-call as your camera is busy with OBS. In this case you can use the Teams app on your smartphone (unibz does not want us to use Whatsapp or Telegram) using your rear camera to show me your screen. Please do some tests to hold it still and put the screen on focus since with trembling hands and out-of-focus I cannot help you.

Algorithms with Python and Cryptocurrencies and blockchain technology

This part will be an oral examination on Teams. Note that oral examinations are public, so there could be other people connected (who obviously cannot speak!). I will not record the exam. I will ask you to show me your surroundings and there must be nobody around nor any course's material nor any other screen. You may hold an A4 paper with you which has one face written with whatever you want, including course's material. You will be evaluated on what you say, how you say it and on how much time does it take to answer (spending 10 minutes reading your A4 paper every time will penalise you).


If I suspect you are cheating or have cheated, I will interrupt the exam and report to the Dean. I remind you that the regulations of the Faculty of Economics prescribe for cheating a suspension of one entire session for all exams and one entire year for this exam. It has already happened to some of your colleagues in the past, so please do not even try to cheat.

Study resources

Lessons' slides
Videos as replacement of attendance
Written material as support
Precourse No slides anymore in 2019 Go down here

No books in 2019!

Python No slides anymore in 2019 Go down here No books in 2019!
Algorithms and complexity No slides anymore in 2019 Go down here No books in 2019!
Cryptocurrences Slides Go down here No books in 2019!


Files and programs used in class
Go to this directory here

Python 3 versus Python 2

Issue Python 2 Python 3
print it is a command:
print <string>
it is a function, therefore it needs parentheses:
print with trailing comma a trailing comma after print suppresses new line:
print <string>,
to suppress new line use:
print(<string>, end="")
integer division 5/2 gives 2. To get the float result:
either 5.0/2 or float(5)/2 or 5/2.0 or 5/float(2); float(5/2) still returns 2.0

5/2 gives 2.5
If you want the integer division, use 5//2

requests.get(<pageAddress>) its .content is type str its .content is type byte, covert it to string with str(page.content) before using it for .find
dict order is decided by the computer memory, so do not rely on it order is exactly the insertion order
range function range function returns a list range function returns a range object. To get a list:
xrange function xrange function returns a range object, like range in Python 3  
sha256 sha256(<string>).hexdigest() sha256(<string>.encode('utf-8')).hexdigest()

Videos of lessons

course brief presentation
YouTube Brief course presentation
precourse 01
YouTube Precourse for Windows 10 on unibz network and file handling, first part.
precourse 02
YouTube Precourse for Windows 10 on unibz network and file handling, second part.
precourse Mac 01
YouTube Precourse for Mac on unibz network and file handling, first part.
precourse Mac 02
YouTube Precourse for Mac on unibz network and file handling, second part.
01 installing Anaconda
YouTube For Python we will use Anaconda with Jupyter and Python 3 (in the video I install 2.7 but the procedure is identical)
01bis refusing to install Anaconda
YouTube For those who do not have a notebook (and borrow one from the library) or refuse to install Anaconda
02 basic Python
YouTube Basic Python programming, Bakus-Naur form, integer and float variables, string variables, find method.
How to solve problems

How to solve computer problems explained with a carpentry example

03 procedures and decisions
YouTube Procedures, tab, logical expressions, and, or, not, If, else, elif.
04 flowcharts
YouTube Flowcharts
05 while and complexity
YouTube While loops, break, multiple assignment, computational complexity
06 Search engine
YouTube Building a search engine: retrieve the links
07 Solving problems
YouTube How to tackle a computational problem
08 Lists
YouTube Lists and strings, loops, objects and their differences towards variables.
09 Search engine
YouTube Building a search engine: crawling
10 Dictionaries
YouTube Flags, dictionaries, tuples.
13 Search engine
YouTube Finishing our search engine. Indexing the words
12 Hash functions
YouTube Using hashes for fingerprints, for existence proof, for hiding PIN or passwords, for mining bitcoins
21 Search algorithms
YouTube Majority problem, Sequential search, Binary search, recursion
22 Sorting algorithms
YouTube Bubble Sort and Merge Sort
23 Timetable problem
YouTube Brute-force algorithm
24 Knapsack problem
YouTube Knapsack problem with branch and bound algorithm
25 Backtracking algorithm
YouTube Backtracking algorithm applied to timetable problem
26 Graphs and paths
YouTube Finding all paths in a graph. Edmonds–Karp algorithm
cryptocurrencies and blockchain technology
YouTube A decentralised currency, basic cryptography, Bitcoin history and technology, blockchain technology, advantages and criticisms


Before the exam:

  1. if you do not use your own notebook, borrow a computer from the library well before the exam and configure it before the exam
  2. make sure that Anaconda is installed and that you can use Jupyter for Python;
  3. check that you are able to locate \\\Courses directory;
  4. just in case your notebook crashes the night before, some days before the exam borrow a computer from the library and check that you are able to log in on your unibz account and that you have, or are able to install, everything you need

Frequently Asked Questions

Q: Which software do I need for Python on my notebook?
Anaconda is available for Windows and for Mac. Take care to install Python 3. Watch the videos for details.

Q: How can I type backslash, square bracket, straight vertical, curly braces on the German keyboard of a Mac?
A: Did you want to buy a Mac with a German keyboard? For programming it is lacking some fundamental keys. Here the shortcuts:
- backslash \ is obtained with ALT+SHIFT+7
- square brackets [ and ] are obtained with ALT+5 and ALT+6
- straight vertical | is obtained with ALT+7
- curly braces { and } are obtained with ALT+8 and ALT+9

Q: How can I type square bracket, at symbol, curly braces on the Italian keyboard of a Mac using VMware?
A: Did you want to buy a Mac with a Italian keyboard? I do not understand why the left Option-Alt key is working only for the euro symbol. Here the shortcuts:
- square brackets [ and ] are obtained with RIGHT ALT+8 and RIGHT ALT+9
- at symbol @ is obtained with RIGHT ALT+Q
- curly braces { and } are obtained with RIGHT ALT+7 and RIGHT ALT+0

Q: How can I reach network folder \\ubz01fst from outside unibz or connected via wifi?
A: For Windows users: if you are connected to wifi ScientificNetwork try to digit in any explorer address bar \\ and see whether you reach it. You need to provide your login and password, but you need to tell to your computer that you are using a different domain and then you have to type unibz\loginname instead of simply loginname. If this fails or if you are no connected to ScientificNetwork, then you need to install VPN. Just go to and follow the instructions to install Cisco Anywhere Client.
For Mac users: if you are connected to wifi ScientificNetwork, Finder -> Go -> Connect to server -> smb:// . You need to provide your login and password, but you need to tell to your computer that you are using a different domain and then you have to type unibz\loginname instead of simply loginname.

Q: May I fix an appointment to talk with you?
A: Sure, write me an email and I will fix an office hour for you at NOI or at unibz. Alternatively, you can write me your questions via email or Teams message and I shall answer very soon.

Q: When will the next exam be? Can you give me a hint on the exam's date because I have to catch a plane? Can you move the exam's date? Can you fix the exam's date on the week I suggest?
A: Please stop writing me emails on this topic. Exam's date appears on your timetable as soon as it is official. If you have something to say about it, contact your students' speaker who is the only one who can submit requests on students' behalf.

Q: I may not enrol online for technical or administrative reasons or I forgot to enrol or it is my third attempt and I cannot enrol. Can I do the exam anyway?
A: No, I may not let non-enrolled students take part of the exam. Do not ask me to do illegal things! Ask the secretary whether there is something they can do.

Q: May I use the operating system in a different language?
A: Yes, sure. Your business.

Q: Will the exam be similar to the other exams on this website?
A: Sure. For the first year (2018/19) I shall put a couple of exam's prototypes. For the other years, I still have not put exams as almost every student did it through midterms.

Q: I lost a file during the practical exam because I did not save it correctly. What may you do?
A: Absolutely nothing. With time spent on exercises you should know the unreliability level of your programs, and how often you have to save.

Q: My files were not copied correctly at the end of the practical exam. What may I do?
A: Checking that the copy is correct, and practicing file copy even during the exam, is your task and is official prerequisite for this course.

Previous exams

Exam and solution link
Python training exercises
exam and solution
prototype for A.Y. 2019/20
exam and solution
prototype for A.Y. 2019/20

exam and solution

Just to give you some examples of written questions on cryptocurrencies given in the past years:

This page is maintained by Paolo Coletti.

Marisa Crucitti il teatro per ringiovanire Paolo Coletti personal page La stanza dell'arte Paolo Coletti Paolo Associazione culturale e ricreativa Kender Trento Bolzano La stanza dell'arte Marzia Centro Felix Trento Aarghen Thael Il Vecchio Continente GURPS Marisa Crucitti il teatro per ringiovanire Laboratorio d'arte Gabbana cornici Rovereto Nursing Up sindacato infermieri Bolzano ASL Italia Advanced Squad Leader Club scherma Bolzano Bozen Fecht club spada fioretto sciabola