<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk:443/22116/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=WikiSysop</id>
	<title>22116 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk:443/22116/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=WikiSysop"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php/Special:Contributions/WikiSysop"/>
	<updated>2026-05-16T10:47:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=310</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=310"/>
		<updated>2026-01-14T07:48:26Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Requirements for taking the course */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
Using AI/ChatGPT is a bad idea. From my observations and exam results, the use of AI hinders the acquisition of &amp;quot;programmatic thinking&amp;quot;. This skill is what the course is about - the core competence. When asking AI about a problem, you are usually served a solution. Even if you understand the solution, then you have not gone through the process of thinking the solution. It weakens your thinking enormously, you don&#039;t &amp;quot;own&amp;quot; the solution and you are not getting used to thinking about programming problems. This becomes a big problem at exam time, because you think you are OK, but you have not acquired the correct thinking and the exam will seem very hard. Yes, there are a number of elements in the exam that we have been going through in the course, but there are also new elements (not python elements, but logic problems) where you have to think your way through.&lt;br /&gt;
&lt;br /&gt;
You can read these American studies showing how the use of AI damages your thinking:&lt;br /&gt;
[https://www.microsoft.com/en-us/research/wp-content/uploads/2025/01/lee_2025_ai_critical_thinking_survey.pdf The Impact of Generative AI on Critical Thinking: Self-Reported Reductions in Cognitive Effort and Confidence Effects From a Survey of Knowledge Workers] and [https://arxiv.org/abs/2506.08872 Your Brain on ChatGPT: Accumulation of Cognitive Debt when Using an AI Assistant for Essay Writing Task].&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=309</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=309"/>
		<updated>2026-01-14T07:46:35Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Requirements for taking the course */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
Using AI/ChatGPT is a bad idea. From my observations and exam results, the use of AI hinders the acquisition of &amp;quot;programmatic thinking&amp;quot;. This skill is what the course is about - the core competence. When asking AI about a problem, you are usually served a solution. Even if you understand the solution, then you have not gone through the process of thinking the solution. It weakens your thinking enormously, you don&#039;t &amp;quot;own&amp;quot; the solution and you are not getting used to thinking about programming problems. This becomes a big problem at exam time, because you think you are OK, but you have not acquired the correct thinking and the exam will seem very hard. Yes, there are a number of elements in the exam that we have been going through in the course, but there are also new elements (not python elements, but logic problems) where you have to think your way through.&lt;br /&gt;
&lt;br /&gt;
You can read these American studies showing how the use of AI damages your thinking: [https://www.microsoft.com/en-us/research/wp-content/uploads/2025/01/lee_2025_ai_critical_thinking_survey.pdf The Impact of Generative AI on Critical Thinking: Self-Reported&lt;br /&gt;
Reductions in Cognitive Effort and Confidence Effects From a Survey of Knowledge Workers], [https://arxiv.org/abs/2506.08872 Your Brain on ChatGPT: Accumulation of Cognitive Debt when Using an AI Assistant for Essay Writing Task].&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=308</id>
		<title>22116/22166 Python programming in Life Science</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=308"/>
		<updated>2025-12-22T14:54:02Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039; [https://www.inside.dtu.dk/da/dtuinside/generelt/telefonbog/person?id=816&amp;amp;cpid=214027&amp;amp;tab=2&amp;amp;qt=dtupublicationquery Peter Wad Sackett], pwsa@dtu.dk &amp;lt;!--, [https://www.inside.dtu.dk/en/dtuinside/generelt/telefonbog/person?id=130596&amp;amp;tab=0 Gisle Alberg Vestergaard], gisves@dtu.dk --&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Language:&#039;&#039;&#039; The course is taught in English.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Tools:&#039;&#039;&#039; The course is using the standard DTU python setup, see [https://pythonsupport.dtu.dk/ https://pythonsupport.dtu.dk/] if you do not have it already.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Textbooks:&#039;&#039;&#039; I believe students should not pay at lot of money for textbooks. I will use powerpoints, videos and references to online resources. You can find the material under the individual lessons in the [[Programme]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Location:&#039;&#039;&#039; Building 358, room 60b + streaming to room 046, no matter what your plan says. Course 22116 and 22166 are taught together.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Monday 13:00 - 17:00, module E2-A.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Course details ==&lt;br /&gt;
There are no plans for streaming the lectures. &amp;lt;!-- as there already are some recorded video lectures for each session. However, with over 180 students two teaching rooms must be used. I will stream the teaching from one room to the other. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Programme]] Fall 2025&lt;br /&gt;
&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/22116/progress/ See the progress of your hand-ins]&lt;br /&gt;
&lt;br /&gt;
[[How the course is conducted]] Required reading - read or fail.&lt;br /&gt;
&lt;br /&gt;
[[Course Survival Guide]] Useful when you get stuck early&lt;br /&gt;
&lt;br /&gt;
[[AI guidelines for the course]] You want to use AI, then you MUST read it.&lt;br /&gt;
&lt;br /&gt;
[[Good code]] Always keep this in mind&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[https://docs.google.com/spreadsheets/d/1wEs2xS-7DmpMvtosweTzYw0Fx3_XCbz4k5cuN5tJVK8/edit?usp=sharing Put yourself on the Get Help list]&lt;br /&gt;
&lt;br /&gt;
[[Course First Aid]]&lt;br /&gt;
&lt;br /&gt;
[[Grading]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Competences ==&lt;br /&gt;
A general engineering competence skill is the ability to explain the process through which you obtain your results - how else can they be trusted?&lt;br /&gt;
Learning to program is a great way to practice that skill, since you have to explain to the computer how it is supposed to solve the task you give.&lt;br /&gt;
This explanation must pay attention to detail, specifically identifying and ordering the elements of the solution. &lt;br /&gt;
This nurtures and strengthens an analytical and structured mindset which is also an essential engineering competence skill.&lt;br /&gt;
Training these skills is obviously beneficial for the student, but they do not come for free - it is &#039;&#039;&#039;hard work&#039;&#039;&#039;, so put the time aside for it.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Online: [https://teaching.healthtech.dtu.dk/material/22116/clean_code.html Clean Code] by Lukasz Dynowski. An amazing read that is mandatory. Read it once around lesson 5 and once more around lesson 8.&lt;br /&gt;
* Info: [[Biological knowledge needed in the course]]&lt;br /&gt;
* Online: [https://rosalind.info/problems/locations/ Rosalind project] Python exercises at different levels for practicing &lt;br /&gt;
&lt;br /&gt;
* Online: [https://www.coursera.org/learn/python Coursera course: Programming for Everybody] is a beginner course in Python. Everyone who wants to prepare for course 22116/22166 can start here. Just get far enough so you understand what programming is and how it works. That will benefit you a lot as a newbie. The [https://teaching.healthtech.dtu.dk/material/22118/CourseraPythonBook_270.pdf Coursera textbook].&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Learning Python&#039;&#039;, 5th ed. by Mark Lutz (O&#039;Reilly) ISBN: 978-1-449-35573-9. This is the best Python book I have read. It covers all the basics and then some. All from the perspective of being a novice programmer. However, it is a brick; big, heavy and unwieldy. If you only want one Python book, then this should be the one. The course will not be taught from this book, but it could be good to have as a Python reference manual.&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Python Crash Course: A Hands-On, Project-Based Introduction to Programming&#039;&#039; by Eric Matthes (No Starch Press) ISBN: 1593276036, 9781593276034. A pretty OK book which leads you into the Python world without too many distracting points and theoretical contemplation.&lt;br /&gt;
&lt;br /&gt;
* Online: [https://wiki.python.org/moin/BeginnersGuide/NonProgrammers Python for Non-Programmers]&lt;br /&gt;
* Online: [https://docs.python.org/3/tutorial/ Official Python 3 tutorial]&lt;br /&gt;
* Online: [https://docs.python.org/3/reference/index.html Python 3 reference manual]&lt;br /&gt;
* Online: [https://docs.python.org/3/library/index.html Python 3 standard library]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Videos with advice on learning how to code&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=A8ldqcFS5S8 How I Would Learn To Code If I Was To Start Over] by Tiff In Tech&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=_nsV65jUPL8 Coding Was Hard Until I Learned THESE 5 Things!] by Pooja Dutt&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=MHPGeQD8TvI How I would learn to code (if I could start over)] by Tina Huang&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=To8hKb112Aw How I would learn to code (if I could start over)] by PIRATE KING&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=9s29LKfEFjQ How I would learn to code (If I could start over)] by Jason Goodison&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=NtfbWkxJTHw How to Learn to Code - 8 Hard Truths] by Fireship&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interesting but less teaching oriented material&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Online: [http://ivory.idyll.org/blog/big-data-biology.html Top 12 reasons you know you are a Big Data biologist]&lt;br /&gt;
* Online: [http://lifehacker.com/six-life-lessons-ive-learned-from-programming-1502077380 How programming and your life is similar]&lt;br /&gt;
* Youtube: [http://www.youtube.com/watch?v=nKIu9yen5nc What most schools don&#039;t teach - how to think]&lt;br /&gt;
&lt;br /&gt;
== Archive of old course programmes ==&lt;br /&gt;
None yet, as the course is new.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=307</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=307"/>
		<updated>2025-12-22T14:53:01Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
Using AI/ChatGPT is a bad idea. From my observations and exam results, the use of AI hinders the acquisition of &amp;quot;programmatic thinking&amp;quot;. This skill is what the course is about - the core competence. When asking AI about a problem, you are usually served a solution. Even if you understand the solution, then you have not gone through the process of thinking the solution. It weakens your thinking enormously, you don&#039;t &amp;quot;own&amp;quot; the solution and you are not getting used to thinking about programming problems. This becomes a big problem at exam time, because you think you are OK, but you have not acquired the correct thinking and the exam will seem very hard. Yes, there are a number of elements in the exam that we have been going through in the course, but there are also new elements (not python elements, but logic problems) where you have to think your way through.&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=306</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=306"/>
		<updated>2025-12-22T14:50:23Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Requirements for taking the course */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
Using AI/ChatGPT is a bad idea. From my observations and exam results, the use of AI hinders the acquisition of &amp;quot;programmatic thinking&amp;quot;. This skill is what the course is about - the core competence. When asking AI about a problem, you are usually served a solution. Even if you understand the solution, then you have not gone through the process of thinking the solution. It weakens your thinking enormously, you don&#039;t &amp;quot;own&amp;quot; the solution and you are not getting used to thinking about programming problems. This becomes a big problem at exam time, because you think you are OK, but you have not acquired the correct thinking and the exam will seem very hard. Yes, there are a number of elements in the exam that we have been going through in the course, but there are also new elements (not python elements, but logic problems) where you have to think your way through.&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=305</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=305"/>
		<updated>2025-12-22T14:49:32Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Requirements for taking the course */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
Using AI/ChatGPT is a bad idea. From my observations and exam results, the use of AI hinders the acquisition of &amp;quot;programmatic thinking&amp;quot;. This skill is what the course is about - the core competence. When asking AI about a problem, you are usually served a solution. Even if you understand the solution, then you have not gone through the process of thinking the solution. It weakens your thinking enormously, you don&#039;t &amp;quot;own&amp;quot; the solution and you are not getting used to thinking about programming problems. This becomes a big problem at exam time, because you think you are OK, but you have not acquired the correct thinking and the exam will seem very hard. Yes, there are a number of elements in the exam that we have been going through in the course, but there are also new elements (not python elements, but logic problems) where you think your way through.&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=304</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=304"/>
		<updated>2025-12-22T14:32:16Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Peer evaluation of exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requirements for taking the course ==&lt;br /&gt;
&#039;&#039;&#039;You most take this seriously. Half of the students failed the course first year it ran.&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This course requires that you have previously taken 5 ECTS in a beginner course in programming. DTU students have taken [https://kurser.dtu.dk/course/02002 02002 Computer Programming (Polytechnical Foundation)], however foreign Master students are more of a mixed group. This course can NOT be treated as your first real programming course - it is your second, and the difficulty of the course and exam reflects that. I have tried to make the course accessible to people with a moderate background in programming, but it is not a free ride. I have an obsolete beginner course [https://teaching.healthtech.dtu.dk/22101/ 22101 Introduction to programming in Life Science using Python] which you can learn from on your own, if your background is insufficient and you want to take this course anyway.&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=303</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=303"/>
		<updated>2025-12-22T12:32:46Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out &#039;&#039;&#039;.py&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam &#039;&#039;&#039;.py&#039;&#039;&#039; file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=302</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=302"/>
		<updated>2025-12-22T12:31:55Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* How much is required to pass? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The &#039;&#039;&#039;.py&#039;&#039;&#039; file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=301</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=301"/>
		<updated>2025-12-22T12:30:53Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Peer evaluation of exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, you will be asked many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The .py file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=300</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=300"/>
		<updated>2025-12-22T12:27:55Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some hand-in time irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The .py file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=299</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=299"/>
		<updated>2025-12-22T12:27:22Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;There will be some irregularity at the end of the semester, due to exams. Pay attention.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. You can only evaluate if you have handed in exercises, so the hand-in is required.&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a Jupyter Notebook for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation. Many people use VScode for this, but it is up to you. In the last part of the course, this is changed to a &#039;&#039;&#039;.py&#039;&#039;&#039; file, to get you used to how the exam will be.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
DTU Learn does not allow for late hand-in. Set an alarm on your phone to remember.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The .py file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=298</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=298"/>
		<updated>2025-11-26T22:08:15Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
=== How much is required to pass? ===&lt;br /&gt;
The .py file is mostly structure and does not give much advice in how to solve the assignments. It is for you to show that you have learned to analyze a programming problem and come up with a solution. As you will be given both the input files and the output files, you can check how well you have succeeded. A correct solution to both assignments is an automatic pass. A correct solution to only one assignment, without any constructive work (in my evaluation) on the other assignment is not enough for a pass. No correct solutions, but writing good sensible code (again in my evaluation) can pass, as it shows you have learned essential things in the course. Comments are part the the essential things.&amp;lt;br&amp;gt;&lt;br /&gt;
In the end, unless you passed automatically, it comes down to a overall evaluation of your hand-in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=297</id>
		<title>22116/22166 Python programming in Life Science</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=297"/>
		<updated>2025-10-28T09:45:11Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Course details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039; [https://www.inside.dtu.dk/da/dtuinside/generelt/telefonbog/person?id=816&amp;amp;cpid=214027&amp;amp;tab=2&amp;amp;qt=dtupublicationquery Peter Wad Sackett], pwsa@dtu.dk &amp;lt;!--, [https://www.inside.dtu.dk/en/dtuinside/generelt/telefonbog/person?id=130596&amp;amp;tab=0 Gisle Alberg Vestergaard], gisves@dtu.dk --&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Language:&#039;&#039;&#039; The course is taught in English.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Tools:&#039;&#039;&#039; The course is using the standard DTU python setup, see [https://pythonsupport.dtu.dk/ https://pythonsupport.dtu.dk/] if you do not have it already.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Textbooks:&#039;&#039;&#039; I believe students should not pay at lot of money for textbooks. I will use powerpoints, videos and references to online resources. You can find the material under the individual lessons in the [[Programme]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Location:&#039;&#039;&#039; Building 358, room 60b + streaming to room 046, no matter what your plan says. Course 22116 and 22166 are taught together.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Monday 13:00 - 17:00, module E2-A.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Course details ==&lt;br /&gt;
There are no plans for streaming the lectures as there already are some recorded video lectures for each session. However, with over 180 students two teaching rooms must be used. I will stream the teaching from one room to the other.&lt;br /&gt;
&lt;br /&gt;
[[Programme]] Fall 2025&lt;br /&gt;
&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/22116/progress/ See the progress of your hand-ins]&lt;br /&gt;
&lt;br /&gt;
[[How the course is conducted]] Required reading&lt;br /&gt;
&lt;br /&gt;
[[Course Survival Guide]] Useful when you get stuck early&lt;br /&gt;
&lt;br /&gt;
[[AI guidelines for the course]] You want to use AI, then you MUST read it.&lt;br /&gt;
&lt;br /&gt;
[[Good code]] Always keep this in mind&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[https://docs.google.com/spreadsheets/d/1wEs2xS-7DmpMvtosweTzYw0Fx3_XCbz4k5cuN5tJVK8/edit?usp=sharing Put yourself on the Get Help list]&lt;br /&gt;
&lt;br /&gt;
[[Course First Aid]]&lt;br /&gt;
&lt;br /&gt;
[[Grading]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Competences ==&lt;br /&gt;
A general engineering competence skill is the ability to explain the process through which you obtain your results - how else can they be trusted?&lt;br /&gt;
Learning to program is a great way to practice that skill, since you have to explain to the computer how it is supposed to solve the task you give.&lt;br /&gt;
This explanation must pay attention to detail, specifically identifying and ordering the elements of the solution. &lt;br /&gt;
This nurtures and strengthens an analytical and structured mindset which is also an essential engineering competence skill.&lt;br /&gt;
Training these skills is obviously beneficial for the student, but they do not come for free - it is &#039;&#039;&#039;hard work&#039;&#039;&#039;, so put the time aside for it.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Online: [https://teaching.healthtech.dtu.dk/material/22116/clean_code.html Clean Code] by Lukasz Dynowski. An amazing read that is mandatory. Read it once around lesson 5 and once more around lesson 8.&lt;br /&gt;
* Info: [[Biological knowledge needed in the course]]&lt;br /&gt;
* Online: [https://rosalind.info/problems/locations/ Rosalind project] Python exercises at different levels for practicing &lt;br /&gt;
&lt;br /&gt;
* Online: [https://www.coursera.org/learn/python Coursera course: Programming for Everybody] is a beginner course in Python. Everyone who wants to prepare for course 22116/22166 can start here. Just get far enough so you understand what programming is and how it works. That will benefit you a lot as a newbie. The [https://teaching.healthtech.dtu.dk/material/22118/CourseraPythonBook_270.pdf Coursera textbook].&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Learning Python&#039;&#039;, 5th ed. by Mark Lutz (O&#039;Reilly) ISBN: 978-1-449-35573-9. This is the best Python book I have read. It covers all the basics and then some. All from the perspective of being a novice programmer. However, it is a brick; big, heavy and unwieldy. If you only want one Python book, then this should be the one. The course will not be taught from this book, but it could be good to have as a Python reference manual.&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Python Crash Course: A Hands-On, Project-Based Introduction to Programming&#039;&#039; by Eric Matthes (No Starch Press) ISBN: 1593276036, 9781593276034. A pretty OK book which leads you into the Python world without too many distracting points and theoretical contemplation.&lt;br /&gt;
&lt;br /&gt;
* Online: [https://wiki.python.org/moin/BeginnersGuide/NonProgrammers Python for Non-Programmers]&lt;br /&gt;
* Online: [https://docs.python.org/3/tutorial/ Official Python 3 tutorial]&lt;br /&gt;
* Online: [https://docs.python.org/3/reference/index.html Python 3 reference manual]&lt;br /&gt;
* Online: [https://docs.python.org/3/library/index.html Python 3 standard library]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Videos with advice on learning how to code&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=A8ldqcFS5S8 How I Would Learn To Code If I Was To Start Over] by Tiff In Tech&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=_nsV65jUPL8 Coding Was Hard Until I Learned THESE 5 Things!] by Pooja Dutt&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=MHPGeQD8TvI How I would learn to code (if I could start over)] by Tina Huang&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=To8hKb112Aw How I would learn to code (if I could start over)] by PIRATE KING&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=9s29LKfEFjQ How I would learn to code (If I could start over)] by Jason Goodison&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=NtfbWkxJTHw How to Learn to Code - 8 Hard Truths] by Fireship&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interesting but less teaching oriented material&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Online: [http://ivory.idyll.org/blog/big-data-biology.html Top 12 reasons you know you are a Big Data biologist]&lt;br /&gt;
* Online: [http://lifehacker.com/six-life-lessons-ive-learned-from-programming-1502077380 How programming and your life is similar]&lt;br /&gt;
* Youtube: [http://www.youtube.com/watch?v=nKIu9yen5nc What most schools don&#039;t teach - how to think]&lt;br /&gt;
&lt;br /&gt;
== Archive of old course programmes ==&lt;br /&gt;
None yet, as the course is new.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=296</id>
		<title>22116/22166 Python programming in Life Science</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=296"/>
		<updated>2025-10-27T13:54:42Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Course details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039; [https://www.inside.dtu.dk/da/dtuinside/generelt/telefonbog/person?id=816&amp;amp;cpid=214027&amp;amp;tab=2&amp;amp;qt=dtupublicationquery Peter Wad Sackett], pwsa@dtu.dk &amp;lt;!--, [https://www.inside.dtu.dk/en/dtuinside/generelt/telefonbog/person?id=130596&amp;amp;tab=0 Gisle Alberg Vestergaard], gisves@dtu.dk --&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Language:&#039;&#039;&#039; The course is taught in English.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Tools:&#039;&#039;&#039; The course is using the standard DTU python setup, see [https://pythonsupport.dtu.dk/ https://pythonsupport.dtu.dk/] if you do not have it already.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Textbooks:&#039;&#039;&#039; I believe students should not pay at lot of money for textbooks. I will use powerpoints, videos and references to online resources. You can find the material under the individual lessons in the [[Programme]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Location:&#039;&#039;&#039; Building 358, room 60b + streaming to room 046, no matter what your plan says. Course 22116 and 22166 are taught together.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Monday 13:00 - 17:00, module E2-A.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Course details ==&lt;br /&gt;
There are no plans for streaming the lectures as there already are some recorded video lectures for each session. However, with over 180 students two teaching rooms must be used. I will stream the teaching from one room to the other.&lt;br /&gt;
&lt;br /&gt;
[[Programme]] Fall 2025&lt;br /&gt;
&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/22116/progress/ See the progress of your hand-ins] Apparently slightly bugged currently&lt;br /&gt;
&lt;br /&gt;
[[How the course is conducted]] Required reading&lt;br /&gt;
&lt;br /&gt;
[[Course Survival Guide]] Useful when you get stuck early&lt;br /&gt;
&lt;br /&gt;
[[AI guidelines for the course]] You want to use AI, then you MUST read it.&lt;br /&gt;
&lt;br /&gt;
[[Good code]] Always keep this in mind&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[https://docs.google.com/spreadsheets/d/1wEs2xS-7DmpMvtosweTzYw0Fx3_XCbz4k5cuN5tJVK8/edit?usp=sharing Put yourself on the Get Help list]&lt;br /&gt;
&lt;br /&gt;
[[Course First Aid]]&lt;br /&gt;
&lt;br /&gt;
[[Grading]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Competences ==&lt;br /&gt;
A general engineering competence skill is the ability to explain the process through which you obtain your results - how else can they be trusted?&lt;br /&gt;
Learning to program is a great way to practice that skill, since you have to explain to the computer how it is supposed to solve the task you give.&lt;br /&gt;
This explanation must pay attention to detail, specifically identifying and ordering the elements of the solution. &lt;br /&gt;
This nurtures and strengthens an analytical and structured mindset which is also an essential engineering competence skill.&lt;br /&gt;
Training these skills is obviously beneficial for the student, but they do not come for free - it is &#039;&#039;&#039;hard work&#039;&#039;&#039;, so put the time aside for it.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Online: [https://teaching.healthtech.dtu.dk/material/22116/clean_code.html Clean Code] by Lukasz Dynowski. An amazing read that is mandatory. Read it once around lesson 5 and once more around lesson 8.&lt;br /&gt;
* Info: [[Biological knowledge needed in the course]]&lt;br /&gt;
* Online: [https://rosalind.info/problems/locations/ Rosalind project] Python exercises at different levels for practicing &lt;br /&gt;
&lt;br /&gt;
* Online: [https://www.coursera.org/learn/python Coursera course: Programming for Everybody] is a beginner course in Python. Everyone who wants to prepare for course 22116/22166 can start here. Just get far enough so you understand what programming is and how it works. That will benefit you a lot as a newbie. The [https://teaching.healthtech.dtu.dk/material/22118/CourseraPythonBook_270.pdf Coursera textbook].&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Learning Python&#039;&#039;, 5th ed. by Mark Lutz (O&#039;Reilly) ISBN: 978-1-449-35573-9. This is the best Python book I have read. It covers all the basics and then some. All from the perspective of being a novice programmer. However, it is a brick; big, heavy and unwieldy. If you only want one Python book, then this should be the one. The course will not be taught from this book, but it could be good to have as a Python reference manual.&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Python Crash Course: A Hands-On, Project-Based Introduction to Programming&#039;&#039; by Eric Matthes (No Starch Press) ISBN: 1593276036, 9781593276034. A pretty OK book which leads you into the Python world without too many distracting points and theoretical contemplation.&lt;br /&gt;
&lt;br /&gt;
* Online: [https://wiki.python.org/moin/BeginnersGuide/NonProgrammers Python for Non-Programmers]&lt;br /&gt;
* Online: [https://docs.python.org/3/tutorial/ Official Python 3 tutorial]&lt;br /&gt;
* Online: [https://docs.python.org/3/reference/index.html Python 3 reference manual]&lt;br /&gt;
* Online: [https://docs.python.org/3/library/index.html Python 3 standard library]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Videos with advice on learning how to code&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=A8ldqcFS5S8 How I Would Learn To Code If I Was To Start Over] by Tiff In Tech&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=_nsV65jUPL8 Coding Was Hard Until I Learned THESE 5 Things!] by Pooja Dutt&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=MHPGeQD8TvI How I would learn to code (if I could start over)] by Tina Huang&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=To8hKb112Aw How I would learn to code (if I could start over)] by PIRATE KING&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=9s29LKfEFjQ How I would learn to code (If I could start over)] by Jason Goodison&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=NtfbWkxJTHw How to Learn to Code - 8 Hard Truths] by Fireship&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interesting but less teaching oriented material&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Online: [http://ivory.idyll.org/blog/big-data-biology.html Top 12 reasons you know you are a Big Data biologist]&lt;br /&gt;
* Online: [http://lifehacker.com/six-life-lessons-ive-learned-from-programming-1502077380 How programming and your life is similar]&lt;br /&gt;
* Youtube: [http://www.youtube.com/watch?v=nKIu9yen5nc What most schools don&#039;t teach - how to think]&lt;br /&gt;
&lt;br /&gt;
== Archive of old course programmes ==&lt;br /&gt;
None yet, as the course is new.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=295</id>
		<title>22116/22166 Python programming in Life Science</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=22116/22166_Python_programming_in_Life_Science&amp;diff=295"/>
		<updated>2025-10-27T13:54:00Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Course details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039; [https://www.inside.dtu.dk/da/dtuinside/generelt/telefonbog/person?id=816&amp;amp;cpid=214027&amp;amp;tab=2&amp;amp;qt=dtupublicationquery Peter Wad Sackett], pwsa@dtu.dk &amp;lt;!--, [https://www.inside.dtu.dk/en/dtuinside/generelt/telefonbog/person?id=130596&amp;amp;tab=0 Gisle Alberg Vestergaard], gisves@dtu.dk --&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Language:&#039;&#039;&#039; The course is taught in English.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Tools:&#039;&#039;&#039; The course is using the standard DTU python setup, see [https://pythonsupport.dtu.dk/ https://pythonsupport.dtu.dk/] if you do not have it already.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Textbooks:&#039;&#039;&#039; I believe students should not pay at lot of money for textbooks. I will use powerpoints, videos and references to online resources. You can find the material under the individual lessons in the [[Programme]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Location:&#039;&#039;&#039; Building 358, room 60b + streaming to room 046, no matter what your plan says. Course 22116 and 22166 are taught together.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Monday 13:00 - 17:00, module E2-A.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Course details ==&lt;br /&gt;
There are no plans for streaming the lectures as there already are some recorded video lectures for each session. However, with over 180 students two teaching rooms must be used. I will stream the teaching from one room to the other.&lt;br /&gt;
&lt;br /&gt;
[[Programme]] Fall 2025&lt;br /&gt;
&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/22116/progress/ See the progress of your hand-ins]&lt;br /&gt;
&lt;br /&gt;
[[How the course is conducted]] Required reading&lt;br /&gt;
&lt;br /&gt;
[[Course Survival Guide]] Useful when you get stuck early&lt;br /&gt;
&lt;br /&gt;
[[AI guidelines for the course]] You want to use AI, then you MUST read it.&lt;br /&gt;
&lt;br /&gt;
[[Good code]] Always keep this in mind&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
[https://docs.google.com/spreadsheets/d/1wEs2xS-7DmpMvtosweTzYw0Fx3_XCbz4k5cuN5tJVK8/edit?usp=sharing Put yourself on the Get Help list]&lt;br /&gt;
&lt;br /&gt;
[[Course First Aid]]&lt;br /&gt;
&lt;br /&gt;
[[Grading]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Competences ==&lt;br /&gt;
A general engineering competence skill is the ability to explain the process through which you obtain your results - how else can they be trusted?&lt;br /&gt;
Learning to program is a great way to practice that skill, since you have to explain to the computer how it is supposed to solve the task you give.&lt;br /&gt;
This explanation must pay attention to detail, specifically identifying and ordering the elements of the solution. &lt;br /&gt;
This nurtures and strengthens an analytical and structured mindset which is also an essential engineering competence skill.&lt;br /&gt;
Training these skills is obviously beneficial for the student, but they do not come for free - it is &#039;&#039;&#039;hard work&#039;&#039;&#039;, so put the time aside for it.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
* Online: [https://teaching.healthtech.dtu.dk/material/22116/clean_code.html Clean Code] by Lukasz Dynowski. An amazing read that is mandatory. Read it once around lesson 5 and once more around lesson 8.&lt;br /&gt;
* Info: [[Biological knowledge needed in the course]]&lt;br /&gt;
* Online: [https://rosalind.info/problems/locations/ Rosalind project] Python exercises at different levels for practicing &lt;br /&gt;
&lt;br /&gt;
* Online: [https://www.coursera.org/learn/python Coursera course: Programming for Everybody] is a beginner course in Python. Everyone who wants to prepare for course 22116/22166 can start here. Just get far enough so you understand what programming is and how it works. That will benefit you a lot as a newbie. The [https://teaching.healthtech.dtu.dk/material/22118/CourseraPythonBook_270.pdf Coursera textbook].&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Learning Python&#039;&#039;, 5th ed. by Mark Lutz (O&#039;Reilly) ISBN: 978-1-449-35573-9. This is the best Python book I have read. It covers all the basics and then some. All from the perspective of being a novice programmer. However, it is a brick; big, heavy and unwieldy. If you only want one Python book, then this should be the one. The course will not be taught from this book, but it could be good to have as a Python reference manual.&lt;br /&gt;
&lt;br /&gt;
* Book: &#039;&#039;Python Crash Course: A Hands-On, Project-Based Introduction to Programming&#039;&#039; by Eric Matthes (No Starch Press) ISBN: 1593276036, 9781593276034. A pretty OK book which leads you into the Python world without too many distracting points and theoretical contemplation.&lt;br /&gt;
&lt;br /&gt;
* Online: [https://wiki.python.org/moin/BeginnersGuide/NonProgrammers Python for Non-Programmers]&lt;br /&gt;
* Online: [https://docs.python.org/3/tutorial/ Official Python 3 tutorial]&lt;br /&gt;
* Online: [https://docs.python.org/3/reference/index.html Python 3 reference manual]&lt;br /&gt;
* Online: [https://docs.python.org/3/library/index.html Python 3 standard library]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Videos with advice on learning how to code&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=A8ldqcFS5S8 How I Would Learn To Code If I Was To Start Over] by Tiff In Tech&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=_nsV65jUPL8 Coding Was Hard Until I Learned THESE 5 Things!] by Pooja Dutt&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=MHPGeQD8TvI How I would learn to code (if I could start over)] by Tina Huang&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=To8hKb112Aw How I would learn to code (if I could start over)] by PIRATE KING&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=9s29LKfEFjQ How I would learn to code (If I could start over)] by Jason Goodison&lt;br /&gt;
* Youtube: [https://www.youtube.com/watch?v=NtfbWkxJTHw How to Learn to Code - 8 Hard Truths] by Fireship&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interesting but less teaching oriented material&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* Online: [http://ivory.idyll.org/blog/big-data-biology.html Top 12 reasons you know you are a Big Data biologist]&lt;br /&gt;
* Online: [http://lifehacker.com/six-life-lessons-ive-learned-from-programming-1502077380 How programming and your life is similar]&lt;br /&gt;
* Youtube: [http://www.youtube.com/watch?v=nKIu9yen5nc What most schools don&#039;t teach - how to think]&lt;br /&gt;
&lt;br /&gt;
== Archive of old course programmes ==&lt;br /&gt;
None yet, as the course is new.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=294</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=294"/>
		<updated>2025-10-21T05:10:19Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re, math and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=293</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=293"/>
		<updated>2025-10-21T05:07:25Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
Exam aids: You can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=292</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=292"/>
		<updated>2025-10-21T05:05:54Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
Comments that just explains your intentions, but are not supported by code, are disregarded. You can not &amp;quot;talk&amp;quot; your way to a pass, you must code your way to a pass.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=291</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=291"/>
		<updated>2025-10-21T05:03:10Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and employ code modularization.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=290</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=290"/>
		<updated>2025-10-21T05:02:27Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
You are expected to solve the assignments using the course curriculum. In particular, it means &amp;quot;pure&amp;quot; python, maybe using standard libraries like os, sys, re and others, but not 3rd party libraries like pandas or numpy. It also means use of comments to explain what you are doing, and modularization.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=289</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=289"/>
		<updated>2025-10-21T04:38:24Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Using python elements not in the curriculum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make a solution that follows the course progression, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=288</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=288"/>
		<updated>2025-10-21T04:35:18Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make the second solution, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme for your own functions - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=287</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=287"/>
		<updated>2025-10-20T20:05:05Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make the second solution, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code, that mostly contains empty functions. You have to fill out the functions with python code that solves the assignments.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=286</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=286"/>
		<updated>2025-10-20T20:02:31Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make the second solution, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
The last lesson [[Python object model]]&#039;s exercises is an example of the exam format - not the exam content. All the exercises has to be handed in in one single .py file. Every exercise is one individual python function, which calls some specified other functions which together solves the exercise. You can add your own functions, if you feel some functionality is missing, but you must fill and use those given by the exam .py file. Follow the naming scheme - it should be obvious.&lt;br /&gt;
&lt;br /&gt;
At the exam there will likely be 2 assignments - &#039;&#039;&#039;not&#039;&#039;&#039; 6 exercises - that you have to solve.&lt;br /&gt;
&lt;br /&gt;
To the exam, you can bring your computer with all the material from the course; powerpoints, exercises, solutions, etc. There is NO INTERNET and NO AI allowed. In the end, it is the programming skill you acquired during the course, that will make you pass - not any aid you bring. That is why we are doing so many difficult exercises.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=285</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=285"/>
		<updated>2025-10-20T19:43:19Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make the second solution, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code.&amp;lt;br&amp;gt;YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=284</id>
		<title>How the course is conducted</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=How_the_course_is_conducted&amp;diff=284"/>
		<updated>2025-10-20T19:42:59Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Preparation for exam */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Weekly exercises are given every Monday. This constitutes an exercise set. There will be 13 of those.&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises have to be uploaded to &amp;quot;DTU Learn&amp;quot; latest Sunday in the week after the exercises were given, i.e you have 7 days to complete a set.&amp;lt;br&amp;gt;&lt;br /&gt;
Peer evaluation of exercises are done in the following week to be handed in Friday.&amp;lt;br&amp;gt;&lt;br /&gt;
The evaluations are mandatory. At least 11 of 13 evaluations must be handed in - in time - for you to be allowed to take the exam. Since you can only evaluate if you have handed in exercises, then you need to do those, too :-)&amp;lt;br&amp;gt;&lt;br /&gt;
You are required to make a notebook (in VScode) for every exercise set, i.e. every week. The .ipynb file is what you hand in to Peer Evaluation.&amp;lt;br&amp;gt;&lt;br /&gt;
Solutions to each week&#039;s exercises are published before the next week&#039;s lesson on DTU Learn (under Discussions).&amp;lt;br&amp;gt;&lt;br /&gt;
Exercises which are handed in after the solutions are published, are voided and will not count, no matter the reason for being late.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- You can find a link to a Discord server in the announcement on DTU Learn (first page). The intention is that you can group together here and get/give help outside normal class hours. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Peer evaluation of exercises ==&lt;br /&gt;
You must upload the solutions for the exercise set at given lesson to DTU Learn. The following week you must evaluate another students solutions - to be handed in on the Friday. You are getting some help with that as I have published my solutions at that time. You can only evaluate if you have uploaded solutions yourself and &amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;you must have done at least 11 evaluations to participate in the exam.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red&amp;quot;&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;/font&amp;gt; Once you have handed in your solution, then it CAN NOT be changed/improved/replaced with a new version, if you have been evaluated. The system is to blame - nothing I can do. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The peer evaluation is a central part of the learning process. As you will discover, I will be asking many questions about various aspects of the code you will have to evaluate. Initially, it can seem overwhelming, and you might not have been taught about all yet, but it is the same questions week after week, and you mostly have to check boxes, so it will get easier during the course. You learn both by doing the evaluation and by receiving (reading) it.&lt;br /&gt;
&lt;br /&gt;
You can/should use the criteria in [[Good code]] in your own programs and the evaluation. The questions in the evaluation are more in depth than [[Good code]]. The evaluation is anonymous, but known to the teacher.&lt;br /&gt;
&lt;br /&gt;
===Learning from exercises and teachers solutions===&lt;br /&gt;
You obviously learn from doing the exercises. However, that is just phase 1. Reflecting over your own solutions while reading the teachers solutions is extremely useful; It prepares you for the following week, it prepares you for the peer evaluation, it shows you alternative solutions you might not have thought about.&amp;lt;br&amp;gt;&lt;br /&gt;
The solutions are examples with explanations and also cover common mistakes. &#039;&#039;They can be found on DTU Learn under Discussions&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Pythonic exercises===&lt;br /&gt;
Python has several constructs, functions, ways/idioms to do certain things. People who have seen some python before may know of this. When using these methods and ways of thinking the code becomes &amp;quot;pythonic&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
It is a learning objective in the course and important for your future as a programmer to learn to program and to design algorithms.&amp;lt;br&amp;gt;&lt;br /&gt;
It happens especially in the first half of the course that learning to program and making pythonic code are at odds. This can been seen in the teachers solutions - you might think: &amp;quot;Why did he do it this way, when you can do it&lt;br /&gt;
smarter/more intuitive/easier/pythonic this way&amp;quot;. This is the reason - the course prioritizes learning to program more than doing it the pythonic way. When you have learned to make algorithms and code well, you can do this in any language. Pythonic coding only works with python.&lt;br /&gt;
&lt;br /&gt;
If you do not observe this during the course - no problem.&lt;br /&gt;
&lt;br /&gt;
== Special exercises ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;&#039;&#039;&#039;Purple exercises&#039;&#039;&#039; has to be done in pseudo code before you start implementing them in Python. The pseudo code is part of the hand-in for these exercises.&lt;br /&gt;
So - make the pseudocode FIRST, then the real python programs AFTERWARDS for the purple exercises.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using python elements not in the curriculum ==&lt;br /&gt;
Most people sooner or later use python not in the curriculum, or not yet covered by the course progression. There are several reasons for that: They know some python from other courses, they have been using AI to create solutions, they have been reading ahead or they have searched the internet for answers.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While knowledge is good, then there is a reason for why the exercises and the learning materials (powerpoint) are as they are - it is a designed course progression. A very important part of the course is to learn how program, how to think &amp;quot;programming&amp;quot;, how to analyze a problem, how to formulate a strategy/workflow/algorithm that will solve the problem.&amp;lt;br&amp;gt;&lt;br /&gt;
By not following the course progression, then you are not learning to analyze or formulate strategies.&lt;br /&gt;
By not thinking - structuring the code more logically - gaining insight in the natural flow of problem solving, you will lack those skills - that mindset - when you really need it to solve more difficult exercises and/or problems.&amp;lt;br&amp;gt;&lt;br /&gt;
Also, it brings problems to peer evaluation, as not everyone knows python that is outside the curriculum.&lt;br /&gt;
&lt;br /&gt;
If you want to show some fancy python (i.e. outside the curriculum/progression), then make TWO solutions to the exercise. One that shows the fancy python and one that follows the curriculum and the course progression. The last one can then be used for peer evaluation. If you find yourself unable to make the second solution, then maybe you should study the subject some more.&lt;br /&gt;
&lt;br /&gt;
== Preparation for exam ==&lt;br /&gt;
The exam is a 4 hour written exam. You will get the assignments, the input files that you have to use/read/parse, and the output files that you have to create. Most importantly, you will also get a &#039;&#039;&#039;.py&#039;&#039;&#039; file that you will have to fill out. That is basically a text file with python code. YOU CAN NOT HAND IN A JUPYTER NOTEBOOK FILE. Your exam hand-in is only the filled out .py file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
The exam is a multiple choice questionnaire. There will be 72 questions, which should be answered at the best of your ability within 2 hours. There are usually between 5 and 8 choices of answer for each question and there is always one answer which is correct - or more correct than the others. Negative points are not used, i.e. there is no penalty for answering wrong (we call it guessing). You must have 60% correctly answered questions to pass. You have all aids available, but NO INTERNET. This means you can download the powerpoints, my solutions, videos and text books and other stuff you find useful. Likewise you can use Jupyter Notebook since a local version (as used in the course) does not require internet.&amp;lt;br&amp;gt;&lt;br /&gt;
The questions will - obviously - be based on the curriculum. This very concretely means that knowing the context of the powerpoints will be an advantage. There are also questions where you must analyze 8-12 lines of code and answer what it does or what the result of running it is. You do not need extra files for answering.&amp;lt;br&amp;gt;&lt;br /&gt;
There is no trial exam.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Collection_of_files&amp;diff=283</id>
		<title>Collection of files</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Collection_of_files&amp;diff=283"/>
		<updated>2025-10-14T14:47:55Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Last updated: September 5, 2025&amp;lt;br&amp;gt;&lt;br /&gt;
== Files used in various exercises ==&lt;br /&gt;
To download the files to your system, just press the Shift key while you left click on the blue link. Follow the instructions.&amp;lt;br&amp;gt;&lt;br /&gt;
You can play around with these files as much as you like. If you change or destroy them, just download them again.&amp;lt;br&amp;gt;&lt;br /&gt;
Put the files in your course folder on your computer.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--The files have been zipped together in one convenient download for you.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22101/22101_files.zip 22101_files.zip]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Individual files ===&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1.acc ex1.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1.dat ex1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_1.dat ex1_1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_2.dat ex1_2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_3.dat ex1_3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/mixedlines.txt mixedlines.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex5.acc ex5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers1.txt numbers1.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers2.txt numbers2.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers3.txt numbers3.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/badnumbers.txt badnumbers.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/goodnumbers.txt goodnumbers.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/secret.txt secret.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/secret2.txt secret2.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna.dat dna.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna.fsa dna.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/orphans.sp orphans.sp]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/studentweight.txt studentweight.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot1.dat sprot1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot2.dat sprot2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot3.dat sprot3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot4.dat sprot4.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprotall.dat sprotall.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sorted5.acc sorted5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/clean5.acc clean5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1corrupt.dat ex1corrupt.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna7.fsa dna7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/revdna7.fsa revdna7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna7GC.fsa dna7GC.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data1.gb data1.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data2.gb data2.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data3.gb data3.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data4.gb data4.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/start10.dat start10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/res10.dat res10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/aa7.fsa aa7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/uniq5.acc uniq5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/order5.acc order5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/res10.dat res10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/slinger.txt slinger.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/hoist.txt hoist.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/combined.txt combined.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneA.txt geneA.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneB.txt geneB.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneC.txt geneC.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneD.txt geneD.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneE.txt geneE.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/gene_combined.txt gene_combined.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dnanoise.fsa dnanoise.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/fastaout.fsa fastaout.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/alignment.fsa alignment.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVenvelope.txt HIVenvelope.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVenv.fsa HIVenv.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVepitopes.txt HIVepitopes.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVepitopesML.txt HIVepitopesML.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test1.dat test1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test2.dat test2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test3.dat test3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/combinedresult.dat combinedresult.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/matrix.dat matrix.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna-array.dat dna-array.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/column.tab column.tab]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna-array-norm.dat dna-array-norm.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/regulation.txt regulation.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the course, you will be creating the following files which values depends on your choices: sums.fsa selected.fsa rest.fsa&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Collection_of_files&amp;diff=282</id>
		<title>Collection of files</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Collection_of_files&amp;diff=282"/>
		<updated>2025-10-14T14:45:36Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Individual files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Last updated: September 5, 2025&amp;lt;br&amp;gt;&lt;br /&gt;
Warning: This is not complete or correct yet.&lt;br /&gt;
== Files used in various exercises ==&lt;br /&gt;
To download the files to your system, just press the Shift key while you left click on the blue link. Follow the instructions.&amp;lt;br&amp;gt;&lt;br /&gt;
You can play around with these files as much as you like. If you change or destroy them, just download them again.&amp;lt;br&amp;gt;&lt;br /&gt;
Put the files in your course folder on your computer.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--The files have been zipped together in one convenient download for you.&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22101/22101_files.zip 22101_files.zip]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Individual files ===&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1.acc ex1.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1.dat ex1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_1.dat ex1_1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_2.dat ex1_2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1_3.dat ex1_3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/mixedlines.txt mixedlines.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex5.acc ex5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers1.txt numbers1.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers2.txt numbers2.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/numbers3.txt numbers3.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/badnumbers.txt badnumbers.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/goodnumbers.txt goodnumbers.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/secret.txt secret.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/secret2.txt secret2.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna.dat dna.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna.fsa dna.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/orphans.sp orphans.sp]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/studentweight.txt studentweight.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot1.dat sprot1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot2.dat sprot2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot3.dat sprot3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprot4.dat sprot4.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sprotall.dat sprotall.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/sorted5.acc sorted5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/clean5.acc clean5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/ex1corrupt.dat ex1corrupt.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna7.fsa dna7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/revdna7.fsa revdna7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna7GC.fsa dna7GC.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data1.gb data1.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data2.gb data2.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data3.gb data3.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/data4.gb data4.gb]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/start10.dat start10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/res10.dat res10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/aa7.fsa aa7.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/uniq5.acc uniq5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/order5.acc order5.acc]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/res10.dat res10.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/slinger.txt slinger.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/hoist.txt hoist.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/combined.txt combined.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneA.txt geneA.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneB.txt geneB.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneC.txt geneC.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneD.txt geneD.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/geneE.txt geneE.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/gene_combined.txt gene_combined.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dnanoise.fsa dnanoise.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/fastaout.fsa fastaout.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/alignment.fsa alignment.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVenvelope.txt HIVenvelope.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVenv.fsa HIVenv.fsa]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVepitopes.txt HIVepitopes.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/HIVepitopesML.txt HIVepitopesML.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test1.dat test1.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test2.dat test2.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/test3.dat test3.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/combinedresult.dat combinedresult.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/matrix.dat matrix.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna-array.dat dna-array.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/column.tab column.tab]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/dna-array-norm.dat dna-array-norm.dat]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://teaching.healthtech.dtu.dk/material/22116/regulation.txt regulation.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
During the course, you will be creating the following files which values depends on your choices: sums.fsa selected.fsa rest.fsa&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=281</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=281"/>
		<updated>2025-10-14T12:37:15Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download [https://teaching.healthtech.dtu.dk/material/22116/22116_13.py this python file.] It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the function groups in the file. You can write the functions directly in the python file, or use VScode or other Jupyter Notebook editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or perform this process will make you fail the exam, so it is worth spending some time on the procedure.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results, sorted according to the accession, in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=280</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=280"/>
		<updated>2025-10-14T12:35:39Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download [https://teaching.healthtech.dtu.dk/material/22116/22116_13.py this python file.] It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the function groups in the file. You can write the functions directly in the python file, or use VScode or other Jupyter Notebook editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or perform this process will make you fail the exam, so it is worth spending some time on the procedure.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039; sorted according to the accession.&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Stateful_parsing&amp;diff=279</id>
		<title>Stateful parsing</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Stateful_parsing&amp;diff=279"/>
		<updated>2025-10-09T10:51:41Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Required course material for the lesson */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Exceptions and bug handling]]&lt;br /&gt;
|Next: [[List manipulation]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_06-StatefulParsing.ppt Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=fe50507e-9009-49b1-a3a8-af27012d8cdf Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=ce785005-14cd-424a-a406-af27012b3e1b Finding errors with Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=acd48c9a-cacb-4832-9184-af27012c7021 Live coding]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
Using stateful parsing to extract data spanning several lines, by recognizing keywords.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
The following 5 exercises deal with SwissProt. The file sprot1.dat is a SwissProt database entry. Study it carefully. Locate the SwissProt ID (SP96_DICDI), the accession number (P14328) and the amino acid sequence (MRVLLVLVAC....TTTATTTATS). There are other entries ( &#039;&#039;sprot2.dat&#039;&#039;, &#039;&#039;sprot3.dat&#039;&#039;, &#039;&#039;sprot4.dat&#039;&#039;). Your programs should work on those, too. Also your programs must solve all the problems in ONE reading of the file. It is acceptable if you just hand in one program that solves 1 to 4. 5 is separate. These exercises are about studying and understanding the file format.&lt;br /&gt;
&lt;br /&gt;
# Make a program that reads the ID and prints it. Try to use the &amp;quot;walk the line&amp;quot; technique.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Add the following functionality to the program: Read the accession number and print it. Again, walk the line.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;Add the following functionality to the program: Read the amino acid sequence and print it. You really should use stateful parsing in this exercise. Maybe check the video.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Add the following functionality to the program: Verification of amino acid number. This means extract the number from the SQ line (example: SQ SEQUENCE 629 AA;) and check that the amino acid sequence has that number of residues. It should be the program that determines if something is wrong - not the user. Imagine that before you go home, you set the computer to run through a million swisprot entries. The next day, you must be able to see what failed. In a sense you don&#039;t care about what succeeded, as that is the common case. You care about what failed, because it is here you must take action.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Now that you have the ID, accession number and AA sequence save it to a file &#039;&#039;sprot.fsa&#039;&#039; in FASTA format. Look in the file &#039;&#039;dna.fsa&#039;&#039; for an example of FASTA. Notice the first line starts with &amp;gt; and immediately after comes an unique identifier, like an accession number or a SwissProt ID. Any other data must be on the header line only, but in free format. Sequence data is on the following lines. &amp;lt;br&amp;gt;Notice that this exercise incorporates the previous 4, but uses the result in a slightly different way.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In reality you never have just one entry in a SwissProt file. The current SwissProt database contains more than half a million entries and it grows all the time. A bioinformatician can access the database by selecting a subset or the whole database as one file for download and extract the needed information from it. In the file &#039;&#039;sprotall.dat&#039;&#039; the 4 sprot files have been collected as a very small example of what you really meet. The exercise is to read all entries in &#039;&#039;sprotall.dat&#039;&#039; and create one fasta file &#039;&#039;sprotall.fsa&#039;&#039; with the ids, accessions and sequence for all entries. In short, just like the previous exercise but for a file that contains more SwissProt entries. And please, don&#039;t do anything stupid like reading the entire file into a list and start parsing that. These SwissProt excerpts can get really big and it can kill your computer memory doing that.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* Count the number of RA (Author) lines in the &#039;&#039;sprot1-4.dat&#039;&#039; files. &#039;&#039;sprot2.dat&#039;&#039; contains 25 RA lines.&lt;br /&gt;
* Extract the author names from the RA lines in the &#039;&#039;sprot1-4.dat&#039;&#039; files. Display the names - only the names.&lt;br /&gt;
* Continuing previous exercise: Now also extract the title (RT lines). Display like title first on one line, followed by authors on the next. Then empty line followed by the next title and authors and so forth, until no more authors/titles.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=278</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=278"/>
		<updated>2025-10-03T14:40:34Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download [https://teaching.healthtech.dtu.dk/material/22116/22116_13.py this python file.] It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the function groups in the file. You can write the functions directly in the python file, or use VScode or other Jupyter Notebook editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or perform this process will make you fail the exam, so it is worth spending some time on the procedure.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=277</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=277"/>
		<updated>2025-10-03T14:40:12Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download [https://teaching.healthtech.dtu.dk/material/22116/22116_13.py this python file.] It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the function groups in the file. You can write the functions directly in the python file, or use VScode or other Jupitor Notebook editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or perform this process will make you fail the exam, so it is worth spending some time on the procedure.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=276</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=276"/>
		<updated>2025-10-03T14:37:18Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download [https://teaching.healthtech.dtu.dk/material/22116/22116_13.py this python file.] It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=275</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=275"/>
		<updated>2025-10-03T14:33:41Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be saved in the file &#039;&#039;regulation.txt&#039;&#039; along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control. That means each output line looks like &amp;quot;H80240 up&amp;quot; or &amp;quot;H34534 down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=274</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=274"/>
		<updated>2025-10-03T14:30:14Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a main function that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a main function that extracts data from one file and saves it in another, given the accession number, input file &#039;&#039;dna-array.dat&#039;&#039; and output file &#039;&#039;column.tab&#039;&#039;. Search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=273</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=273"/>
		<updated>2025-10-03T14:22:49Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a program that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;The output file is this time &#039;&#039;trans2matrix.dat&#039;&#039; which should be identical with &#039;&#039;trans1matrix.dat&#039;&#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a program that extracts data from &#039;&#039;dna-array.dat&#039;&#039;. It shall ask for an accession number (unless you have given it on the command line). Make sure your program handles both situations. Then it shall search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=272</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=272"/>
		<updated>2025-10-03T14:21:14Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a program that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and save the transposed matrix in the file &#039;&#039;trans1matrix.dat&#039;&#039;. The output should look like the input, that is &#039;&#039;&#039;not&#039;&#039;&#039; a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which gets a matrix as input an returned a transposed matrix - without using any global variables.&amp;lt;br&amp;gt;matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# This is the same problem as the previous exercise, except your transpose function have to transpose the matrix in-line, no returned matrix, i.e. the original matrix data structure is changed.&amp;lt;br&amp;gt;transpose(matrix)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a program that extracts data from &#039;&#039;dna-array.dat&#039;&#039;. It shall ask for an accession number (unless you have given it on the command line). Make sure your program handles both situations. Then it shall search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=271</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=271"/>
		<updated>2025-10-03T14:10:55Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want find the average the numbers from all experiments for each accession number. Save your results in the file &#039;&#039;combinedresults.txt&#039;&#039; in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a program that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and in the end print the transposed matrix to the screen. The output should look like the input, not a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which transpose the matix without using any global variables. This can be done in two ways.&amp;lt;br&amp;gt;&#039;&#039;&#039;a)&#039;&#039;&#039; matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;&#039;&#039;&#039;b)&#039;&#039;&#039; transpose(matrix)&amp;lt;br&amp;gt;Here the matrix is transposed in-line, no returned matrix, i.e. the original data structure is changed.&amp;lt;br&amp;gt;You have implement at least one of the two ways. Hint: Make a function that prints a given matrix. That will be useful underway.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a program that extracts data from &#039;&#039;dna-array.dat&#039;&#039;. It shall ask for an accession number (unless you have given it on the command line). Make sure your program handles both situations. Then it shall search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=270</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=270"/>
		<updated>2025-10-03T14:08:08Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want to average the numbers from all experiments for each accession number. The output this therefore on the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, hint hint -  a dict of lists.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a program that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and in the end print the transposed matrix to the screen. The output should look like the input, not a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which transpose the matix without using any global variables. This can be done in two ways.&amp;lt;br&amp;gt;&#039;&#039;&#039;a)&#039;&#039;&#039; matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;&#039;&#039;&#039;b)&#039;&#039;&#039; transpose(matrix)&amp;lt;br&amp;gt;Here the matrix is transposed in-line, no returned matrix, i.e. the original data structure is changed.&amp;lt;br&amp;gt;You have implement at least one of the two ways. Hint: Make a function that prints a given matrix. That will be useful underway.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a program that extracts data from &#039;&#039;dna-array.dat&#039;&#039;. It shall ask for an accession number (unless you have given it on the command line). Make sure your program handles both situations. Then it shall search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=269</id>
		<title>Python object model</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Python_object_model&amp;diff=269"/>
		<updated>2025-10-03T14:00:10Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Regular expressions]]&lt;br /&gt;
|Next: [[Programme]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_13-Objects.ppt Object model and complex data]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Complex data]]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Python objects&lt;br /&gt;
* Identity&lt;br /&gt;
* Mutable vs immutable&lt;br /&gt;
* Complex data&lt;br /&gt;
* Exam format&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
&#039;&#039;&#039;Important - read this before starting&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This exercise set will be similar to the format of the exam. The content will obviously be different.&amp;lt;br&amp;gt;&lt;br /&gt;
You have to download this python file. It contains some frame work code, but mostly some unfinished functions.&lt;br /&gt;
Each exercise is about finishing one of the functions in the file. You can write the function directly in the python file, or use VScode or other editor to write it, but then it has to be copied over to the python file. You must hand in the finished python file, &#039;&#039;&#039;not&#039;&#039;&#039; a .ipynb file.&amp;lt;br&amp;gt;&lt;br /&gt;
Inability to understand or do this will make you fail the exam, so it is worth spending some time on the process.&lt;br /&gt;
&lt;br /&gt;
# In the file &#039;&#039;test1.dat&#039;&#039; is results from an experiment where every line is in the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber   Number Number Number ....&#039;&#039;&amp;lt;br&amp;gt;In the files &#039;&#039;test2.dat&#039;&#039; and &#039;&#039;test3.dat&#039;&#039; are results from similar experiments but with a slightly different gene set. You want to average the numbers from all experiments for each accession number. The output this therefore on the form:&amp;lt;br&amp;gt;&#039;&#039;AccessionNumber SingleAverageNumberOfAll3Experiments&#039;&#039;&amp;lt;br&amp;gt;Of course it might happen that a certain gene is only in one or two experiments and in that case you calculate the average for those. You must use a one of complex data structures to store this data, preferably a dict of lists.&amp;lt;br&amp;gt;OPTIONAL: If you have time and inclination, then you can also solve this using simple one-dimensional structures.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Create a program that reads a tab separated file with numbers, &#039;&#039;matrix.dat&#039;&#039;, (to be understood as a matrix) and stores the numbers in a matrix (list of lists). Having read the matrix from file it should now transpose it (rows to columns and columns to rows) and in the end print the transposed matrix to the screen. The output should look like the input, not a python data structure.&amp;lt;br&amp;gt;You must construct a function like transpose(matrix), which transpose the matix without using any global variables. This can be done in two ways.&amp;lt;br&amp;gt;&#039;&#039;&#039;a)&#039;&#039;&#039; matrix = transpose(matrix)&amp;lt;br&amp;gt;This is the easiest, but momentarily most memory consuming method, you just return the transposed matrix, i.e. a new data structure.&amp;lt;br&amp;gt;&#039;&#039;&#039;b)&#039;&#039;&#039; transpose(matrix)&amp;lt;br&amp;gt;Here the matrix is transposed in-line, no returned matrix, i.e. the original data structure is changed.&amp;lt;br&amp;gt;You have implement at least one of the two ways. Hint: Make a function that prints a given matrix. That will be useful underway.&amp;lt;br&amp;gt;How do you easily check if it works? Well, transposing twice yields the original matrix. [http://en.wikipedia.org/wiki/Transpose Check out Wikipedia&#039;s entry on transposing a matrix.]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Study the file &#039;&#039;dna-array.dat&#039;&#039; a bit. This is real DNA array data taken from a number of persons, some controls and some suffering from colon cancer. If you look at the second line there is a lot of 0 and 1. A &#039;0&#039; means that values in that column are from a cancer patient and a &#039;1&#039; means data are from a control (healthy person). The data are all log(intensity), i.e. the logarithm of the measured intensity of the relevant spot on the dna-chip. The data in this file will be used in coming exercises. The data/columns are tab separated. The second item on each line is the accession number for that particular gene.&amp;lt;br&amp;gt;Now make a program that extracts data from &#039;&#039;dna-array.dat&#039;&#039;. It shall ask for an accession number (unless you have given it on the command line). Make sure your program handles both situations. Then it shall search in the file for the data concerning that accession number. If it does not find it (you gave a wrong accession no), complain and stop. Otherwise it shall display the data in two tab separated columns. First column shall be the data from the cancer patients, second column for the controls. There are not the same number of sick and healthy people - be able to handle that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The numbers in the input file &#039;&#039;dna-array.dat&#039;&#039; should be normalized between 0 and 1 for each line with an accession number, i.e. normalization only for the individual line - not across the data set. Write the result out in the file &#039;&#039;dna-array-norm.dat&#039;&#039;, but NOT the control lines, i.e. lines where the annotation says &#039;control&#039;. The resulting file will be similar to the original, but control lines are removed and the numbers are different. The problem can (and should) be solved one line at a time.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;dna-array-norm.dat&#039;&#039; and transform all the numbers less than 0.5 to 0, and numbers at 0.5 or more to 1. Now for each line/accession calculate the average of the control group numbers and the cancer group numbers. If the two averages are more than 0.4 from each other, this is considered significant and the accession should be printed along with a message &#039;&#039;&#039;up&#039;&#039;&#039; or &#039;&#039;&#039;down&#039;&#039;&#039; if it is an up regulation or a down regulation of the cancer group compared to the control.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Regular_expressions&amp;diff=268</id>
		<title>Regular expressions</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Regular_expressions&amp;diff=268"/>
		<updated>2025-10-03T13:59:33Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Dict techniques]]&lt;br /&gt;
|Next: [[Python object model]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_12-Regex.ppt Regular expressions in Python]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=04cb2b80-d941-42a5-a632-af27012cd0d7 Regular Expressions] Monday&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=738d525b-a6c1-4973-b6cc-af27012ca86e An (unfortunately) true story]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Regex]]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=2952d382-7059-4691-8170-af27012bc9a1 Live Coding]&amp;lt;br&amp;gt;&lt;br /&gt;
PDF: [https://teaching.healthtech.dtu.dk/material/22116/regular-expressions-cheat-sheet-v2.pdf Regular Expressions Cheat Sheet]&amp;lt;br&amp;gt;&lt;br /&gt;
WWW: [http://regex101.com/ Web page where you can test your regular expressions]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Regular expressions, duh.&lt;br /&gt;
* Patterns, how to design and use them - and not use them.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
Exercise 6 to 8 has strong taste of something I would do at an exam. It is also an interesting beginning of the making a HIV vaccine. The data is real and the methods are real.&lt;br /&gt;
&lt;br /&gt;
# Make a program that accepts a string as input from the keyboard. Use regular expressions (RE) to determine if the input is a number. The goal is to do this with a SINGLE regex.&amp;lt;br&amp;gt; These should all be considered as numbers: &amp;quot;4&amp;quot;   &amp;quot;-7&amp;quot;   &amp;quot;0.656&amp;quot;   &amp;quot;-67.35555&amp;quot;&amp;lt;br&amp;gt; These are not numbers: &amp;quot;5.&amp;quot;  &amp;quot;56F&amp;quot;  &amp;quot;.32&amp;quot;  &amp;quot;-.04&amp;quot;  &amp;quot;1+1&amp;quot;&amp;lt;br&amp;gt; Note: The program is very simple, but it is likely the most difficult regular expression, you will have to make in this set of exercises. Perhaps you should do the following exercises before attempting this one - just to get some experience first.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Regex is often used for validation. This time make a small program that ask for an email address, and checks if it is in a proper format. Quite similar to the previous exercise, just a different thing to validate.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a program that can read and verify a fasta file. Use your previous function &#039;&#039;&#039;fastaread()&#039;&#039;&#039; Test the program with &#039;&#039;dna7.fsa&#039;&#039; and &#039;&#039;dnanoise.fsa&#039;&#039;. Verification here means that the program prints &amp;quot;DNA fasta&amp;quot; or &amp;quot;Protein fasta&amp;quot; if the file is successfully verified for either dna or protein sequence, and &amp;quot;Not fasta&amp;quot; if unsuccessfully verified. You can find a description of fasta format in [[Biological knowledge needed in the course]]. You are expected to know which symbols are used for DNA and protein sequence - or that you are able to look it up.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Building on your experience with the previous exercise, make a program that reads a fasta file, discard entries that can not conform to DNA or protein sequence, and rewrite (using your &#039;&#039;&#039;fastawrite()&#039;&#039;&#039; function) the acceptable entries in the output file &#039;&#039;fastaout.fsa&#039;&#039;, in such a way that the normal 60 chars per line is followed with no spaces in between. The program must inform the user how many entries was kept and how many discarded. Hint: Test on &#039;&#039;dnanoise.fsa&#039;&#039;, which contains 3 entries that should be discarded (V00179, J00265, J02989).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# [[File:consensus.png|50px|right]] In the file &#039;&#039;alignment.fsa&#039;&#039; is a protein alignment of part of the insulin gene from different organisms. Read the fasta file and determine the consensus sequence of the alignment, which you print. The consensus sequence is simply the most frequent occurring amino acid on each position.&amp;lt;br&amp;gt;Consensus: MALWMRLLPLLALLALWEPDPAGAFVNGHLCGSHLVEALYLVCGERGFFYTPKSRREVEDPGVGGLELGGGP&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# All HIV envelope proteins from various HIV strains in SwissProt have been identified and collected in the file &#039;&#039;HIVenvelope.txt&#039;&#039;. Using regular repressions you must extract the ID and the protein sequence from each entry and save them in a fasta file named &#039;&#039;HIVenv.fsa&#039;&#039;. This job is not new to you and you can use your &#039;&#039;&#039;fastawrite()&#039;&#039;&#039; function if you want to.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Continuing the investigation in HIV. Read the &#039;&#039;HIVenv.fsa&#039;&#039; fasta file and create a single set consisting of all possible epitopes for all sequences. Save the epitopes in the file &#039;&#039;HIVepitopes.txt&#039;&#039; - one epitope per line. An epitope is simply a k-mer 9 residues long, which can possibly elicit a immune system response. So save all unique 9-mers in the sequences in the file. To generate a file that you can verify against my file, you must sort the epitopes alphabetically before saving them.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# You must prepare the epitopes in &#039;&#039;HIVepitopes.txt&#039;&#039; for machine learning. A common ML problem is when you have many data points (here epitopes) that look like each other. This introduces an unwanted bias in the ML predictions. Your job is to eliminate epitopes that are too similar using the Hobohm-1 algorithm. Hobohm-1 works like this: Look a the first epitope in the list. Compare it sequentially with the rest of the epitopes. If an epitope is too similar with the first, throw it away. Now no epitopes looks like the first. Proceed to the second epitope and repeat the comparing and possibly throwing away of the subsequent epitopes. Proceed to the third epitope in the list. Repeat this pattern until you have reached the end of the list. Now all epitope left are dissimilar to each other.&amp;lt;br&amp;gt;How to determine if two epitopes are too similar? Easy - you earlier learned about the Hamming distance. Just compute the Hamming distance between two epitopes and if the distance is 3 or less, they are too similar. Save the &amp;quot;surviving&amp;quot; epitopes in the file &#039;&#039;HIVepitopesML.txt&#039;&#039;.&amp;lt;br&amp;gt;Hint: Think about the Hobohm-1 algorithm before you implement it. You can easily run into problems.&amp;lt;br&amp;gt;You should see a reduction from 15909 epitopes to 3842 in 30-60 seconds.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Dict_techniques&amp;diff=267</id>
		<title>Dict techniques</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Dict_techniques&amp;diff=267"/>
		<updated>2025-10-03T13:58:35Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Set techniques]]&lt;br /&gt;
|Next: [[Regular expressions]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_11-Dicts.ppt Dictionaries]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=61d288cc-5f62-4027-a83e-af27012c27d2 Dictionaries]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=7b897492-bedb-4042-a4fc-af27012c0a0b Tips and Tricks]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
Resource: [https://teaching.healthtech.dtu.dk/material/22116/clean_code.html Clean Code] Every time you read it, you will take something from it.&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Dicts]]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=276ecfa4-012e-47b4-b521-af27012b06d9 Live Coding]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Dictionaries - dicts - which are unordered tables of data.&lt;br /&gt;
* Dict methods and functions&lt;br /&gt;
* Dict tips and tricks&lt;br /&gt;
* Dict algorithms&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
# Create a dictionary where the keys are codons and the value are the one-letter-code for the amino acids. The dictionary will function as a look-up table. You can find a [[codon list]] here. You are meant to make the dict &amp;quot;by hand&amp;quot; as there is a structure lesson in that. Add a bit of smart code that tests if you made the dict right.&amp;lt;br&amp;gt; Extra: If you feel like it you can in addition make a program that constructs the dict from a file, which you are responsible for making.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Use the dictionary from the previous exercise and your previous functions &#039;&#039;&#039;fastaread()&#039;&#039;&#039; and &#039;&#039;&#039;fastawrite()&#039;&#039;&#039; in a program, that translates all the nucleotide fasta entries in &#039;&#039;dna7.fsa&#039;&#039; to amino acid sequence. Save the results in a file &#039;&#039;aa7.fsa&#039;&#039; in fasta format. Since the sequences are now consisting of amino acids add &#039;Amino Acid Sequence&#039; to each header. The STOP codon is NOT a part of the amino acid sequence. Think about what STOP means.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In the file &#039;&#039;ex5.acc&#039;&#039; are a lot of accession numbers, where some are duplicates. Earlier we just removed the duplicates, but now we should count them. Make a program that reads the file once, and writes a file &#039;&#039;order5.acc&#039;&#039; with the unique accession numbers and the number of occurrences in the file. A line should look like this: &amp;quot;AC24677 2&amp;quot;, if this accession occurs twice in &#039;&#039;ex5.acc&#039;&#039;. The accession numbers must be written in order, which means the accession with most duplicates is on top (the beginning) and the least on bottom. If two accessions have the same amount of duplicates, they need to be ordered according to the accession name, i.e. AC543322 is before BG001110.&amp;lt;br&amp;gt;Note: This is quite a tricky exercise. If you are absolutely stuck, then at least order the accessions by the number of duplicates and hand in.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;In the tab-separated files &#039;&#039;slinger.txt&#039;&#039; and &#039;&#039;hoist.txt&#039;&#039; are two columns with an accession number and a numeric result; a probability between 0 and 1. The numbers are from running 2 different programs (slinger and hoist, if you are in doubt). You must combine these probabilities - basically taking the average of the two numbers - for each accession number and write the result in a file &#039;&#039;combined.txt&#039;&#039;. The file should look like the sources, i.e. tab-separated with accession in column 1 and number in column 2. Unfortunately, the two programs have not been run from the same set of accession numbers, so some of the results are only available in one of the input files. In such case you ignore/discard the data for that accession. Only save results in the output file when the accession is in both of the input files.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Using above method gives you too little data. You try this time to combine your two input sets differently. If an accession is in both input files you use the average, if it is in only one, you just use the number straight in the output file. This is effectively making a union of the input instead of an intersection.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In the files &#039;&#039;geneA.txt&#039;&#039;, &#039;&#039;geneB.txt&#039;&#039;, all the way down to &#039;&#039;geneE.txt&#039;&#039; you have normalized mRNA expression data taken at the time of discovery of colon cancer for a number of patients and their survival. This is basically 2 columns in each file; The mRNA expression (x) and the number of months (y) the patient survived. For each gene you have to make a [https://en.wikipedia.org/wiki/Simple_linear_regression simple linear regression] analysis and find 3 numbers; the &#039;&#039;&#039;&amp;amp;alpha;&#039;&#039;&#039; (the intercept - where the line cuts the Y-axis) and &#039;&#039;&#039;&amp;amp;beta;&#039;&#039;&#039; (the slope) coefficient that describes the line running through the data points best, and the correlation coefficient (&#039;&#039;&#039;r&#039;&#039;&#039;) which describes the fitness of the line. You must identify the gene that best indicates how long the patient survives. For every gene you start calculating these values.&amp;lt;br&amp;gt;[[File:calc.png|220px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&#039;&#039;n&#039;&#039; = number of observations.&amp;lt;br&amp;gt;From the values you can compute the required parameters.&amp;lt;br&amp;gt;[[File:alfabeta.png|130px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;[[File:correlation.png|200px]]&amp;lt;br&amp;gt;Remember to say which gene best describes survival - and why. A survival prediction can be made by calculating &amp;amp;beta; * x + &amp;amp;alpha;, given x which is the mRNA expression.&amp;lt;br&amp;gt;Note: The genes will in reality interact with each other in ways that totally destroys our basic assumption for making a linear regression: That the data (gene expressions) are independent.&amp;lt;br&amp;gt;Make your code in a general way - there can for example be more data files. Make it easy to add them.&amp;lt;br&amp;gt;The gene with the best correlation coefficient is geneD, with a CC of 83.75%.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Repeat the previous exercise again with a new type of data file &#039;&#039;gene_combined.txt&#039;&#039;, which is more typical in real life. All genes are in one tab separated file. There are 3 columns; gene name, normalized mRNA expression and survival in months. There is no particular order in which the data appears and data lines for several genes might be mixed within each other.&amp;lt;br&amp;gt;Again, make general code. There can be more or fewer genes, and you do not need to know there names beforehand.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* The &#039;&#039;geneA-E.txt&#039;&#039; files all have the same structure on each line; first number is a float between 0 and 1, second number is an integer (representing months of survival after discovery of the cancer). For all files (the combined data set) find the average of the float, given the integer and display in ascending order of the integer. You need to add all the floats for a given integer together and divide by the number of floats for the integer, then you have the average for the integer. To succeed at this, you must use two dicts where the integer is the key in both. The corresponding values are the sum of the floats (for that key) and the number of times the key has been encountered in the files. Hint: Unfortunately, this does not make much biological sense, but is more in the nature of a programming exercise.&lt;br /&gt;
* This exercise requires exercise 6 from [[Simple pattern matching]]. Modify the code a bit so you only compute what you have to. In the &#039;&#039;data1-4.gb&#039;&#039; files count how many times the different codons in the coding sequence occurs. Display.&lt;br /&gt;
* This exercise builds on exercise 2 for this lesson. You must read the &#039;&#039;dna7.fsa&#039;&#039; file and translate the DNA sequences to protein sequence. Report the frequencies of the various amino acids for the entire file - all sequences (not individual sequences). That is - count how many there is of each amino acid (a total) in the translated sequences, compute the frequency of each (Number_of_this_amino_acid/Total_number_of_amino_acids) and print the results as &amp;quot;S   0.0123&amp;quot;, i.e. 4 digits after the dot. You do not need to save the fasta file.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Set_techniques&amp;diff=266</id>
		<title>Set techniques</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Set_techniques&amp;diff=266"/>
		<updated>2025-10-03T13:57:50Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Simple pattern matching]]&lt;br /&gt;
|Next: [[Dict techniques]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_10-Sets.ppt Sets]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e69a7b62-4f83-4b92-b254-af27012c464e Sets]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Sets, which are unordered data collections with no duplicates.&amp;lt;br&amp;gt;&lt;br /&gt;
* Set methods&amp;lt;br&amp;gt;&lt;br /&gt;
* Set uses&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
Many modern bioinformatic algorithms utilizes &#039;&#039;&#039;k-mers&#039;&#039;&#039;. A k-mer is a piece of sequence k units long. The k in the k-mer usually changes size, i.e. length of the sequence depending on the algorithm. It can be both protein and DNA sequence. As an example I have this DNA sequence: GACTAC. It contains the following 4-mers: GACT, ACTA, CTAC. The first 4 exercises works with k-mers and sets and leads up to an algorithm for find the sequence in a group that looks most like a target sequence. Would they be homologs? Good bet.&lt;br /&gt;
&lt;br /&gt;
# From a genbank file like &#039;&#039;data1-4.gb&#039;&#039; extract the DNA sequence (been there - done that). Now insert all 5-mers in the DNA sequence into a set. Compute the following numbers: how many did you insert in the set, how many are in the set, how many different 5-mers could there possibly be. Display. It seems like the two first numbers are the same, but this is not guaranteed to be true. Explain why using your python knowledge.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Calculate the overlap of 5-mers between any two of the &#039;&#039;data1-4.gb&#039;&#039; files. Just ask for two filenames and calculate for these.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a program that asks for a number (integer) then reads the &#039;&#039;dna7.fsa&#039;&#039; file (which contains insulin-like genes) and saves the entry selected by the number in &#039;&#039;selected.fsa&#039;&#039; and the rest of the entries into the file &#039;&#039;rest.fsa&#039;&#039; This should be a fairly easy task since you have your &#039;&#039;&#039;fastaread&#039;&#039;&#039; and &#039;&#039;&#039;fastawrite&#039;&#039;&#039; functions from lesson 8, exercise 5 and 6.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Now that you can select a fasta entry, then read the &#039;&#039;selected.fsa&#039;&#039; and create 5-mers from the sequence. Now read the entries from &#039;&#039;rest.fsa&#039;&#039; and for every entry create the 5-mers from the sequence. Report which sequence in &#039;&#039;rest.fsa&#039;&#039; had the greatest overlap (and how much overlap) with the selected sequence. This must be the sequence that looks most like the selected one.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the sequences in the file &#039;&#039;dna7.fsa&#039;&#039;. Find out which and how many of the 64 codons are &#039;&#039;&#039;not&#039;&#039;&#039; used somewhere in the sequences. Print the unused codons.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;You have made a program (let&#039;s call it the X-program), which as input takes a file of accession numbers, &#039;&#039;start10.dat&#039;&#039; and produces some output, which is in &#039;&#039;res10.dat&#039;&#039;. Now you count the lines in your input file and your output file and you discover that the line numbers do not match. Horror - your program does not produce output for some input. Now the assignment is to discover which accession numbers did not produce output. This can be done in various ways, but now you have to use a set. Print the results.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;In the file &#039;&#039;ex5.acc&#039;&#039; are a lot of accession numbers, where some are duplicates. We have earlier cleaned this file of duplicates. Let&#039;s do that again using a set. Make a program that reads the file once, finds the unique accession numbers and write them to the file &#039;&#039;uniq5.acc&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In the &#039;&#039;data1.gb&#039;&#039; file there are 6 references (to articles). Make a program that extracts all authors from the references, eliminates those that are duplicates and print the list of authors. You will notice that some authors seems to be the same person using different initials. You should only consider a person a duplicate if the name matches exactly. This should also work for the other Genbank entries: &#039;&#039;data2.gb&#039;&#039;, &#039;&#039;data3.gb&#039;&#039; &amp;amp; &#039;&#039;data4.gb&#039;&#039;.&amp;lt;br&amp;gt;Beware: there traps in this exercise, check your output properly.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Simple_pattern_matching&amp;diff=265</id>
		<title>Simple pattern matching</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Simple_pattern_matching&amp;diff=265"/>
		<updated>2025-10-03T13:57:10Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Functions]]&lt;br /&gt;
|Next: [[Set techniques]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_09-PatternMatch.ppt Simple pattern matching]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=4a8a478b-33e4-4a7a-bc38-af27012cf23f Pattern matching in Python]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
[[Example code - Wrong parsing]] What many do, and is sooo bad.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
String pattern matching, stripping, replacement, translation.&amp;lt;br&amp;gt;&lt;br /&gt;
Pattern matching is about 2 things: &#039;&#039;&#039;WHAT&#039;&#039;&#039; is the pattern and &#039;&#039;&#039;WHERE&#039;&#039;&#039; is the pattern.&amp;lt;br&amp;gt;&lt;br /&gt;
It is important to &#039;&#039;&#039;AVOID&#039;&#039;&#039; matching the wrong place.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
The first 7 exercises will all have to do with the files &#039;&#039;data1-4.gb&#039;&#039;, which are various Genbank entries of genes. First you should study the files, notice the structure of the data. In all exercises you will have to parse (read and find the wanted data) the files using pattern matching. Every exercise adds to the previous ones, so the final program grow big and can do a lot. It is part of the practice to be able to keep an overview of the elements of a large program. Use structure and comments to help you keep track.&amp;lt;br&amp;gt;Your program should be able to handle all files, but just one at a time.&lt;br /&gt;
&lt;br /&gt;
# Extract the accession number, the definition and the organism (and print it).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Extract and print all MEDLINE article numbers which are mentioned in the entries.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Extract and print the translated gene (the amino acid sequence). Look for the line starting with /translation=. Generalize; An amino acid sequence can be short, i.e. only one line in the feature table, or long, i.e. more than one line in the feature table. Use stateful parsing.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Extract and print the DNA (whole base sequence in the end of the file). Use stateful parsing.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Your program already extracts the DNA. Make it also extract the positions of the coding sequence. Display them. You can recognize it by the line that starts with &amp;quot;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;CDS&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;join(&amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Now that you have the DNA and the positions in the DNA for the coding sequence, extract the coding DNA directly from the DNA, such that you can display the actual gene. Verify that you have done so correctly by thinking about the properties of coding DNA sequence.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Find all titles and authors using stateful parsing. Put every author/title record (i.e. all authors/title in one string) in one list. Display all neatly with title on one line, authors on the next and a separator line.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Returning all the way back to lesson 6, Stateful parsing, exercise 6. Given the content of today&#039;s lecture, how would you improve this exercise now (shorter, more efficient code) ?&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
You will program a [https://en.wikipedia.org/wiki/Reverse_Polish_notation reverse polish notation] calculator. This is somewhat complicated, so I will split up the job in a number of smaller exercises, where the one exercise builds on the previous. Shortly, reverse polish notation is a mathematical notation in which operators follow their operands, i.e. adding two numbers is written by &amp;quot;3 4 +&amp;quot; instead of &amp;quot;3 + 4&amp;quot;. We will utilize a [https://en.wikipedia.org/wiki/Stack_(abstract_data_type) stack], which is simply a list, where elements are added to and removed from the bottom.&lt;br /&gt;
* Let&#039;s start with making the overall structure; a loop that asks for input, which is one item/command at a time. Inside the loop, there can be a number of operations depending on the input. If you enter a number, it should be simply appended to your list (the stack, which is the word I will use in the rest of the exercises here). If you enter commands &#039;&#039;&#039;STOP&#039;&#039;&#039;, &#039;&#039;&#039;EXIT&#039;&#039;&#039; or &#039;&#039;&#039;QUIT&#039;&#039;&#039;, the loop should end and the program stop. If you enter something that the program does not understand it should write &amp;quot;Illegal command&amp;quot;, but otherwise do nothing.&lt;br /&gt;
* Add the following commands: &#039;&#039;&#039;PEEK&#039;&#039;&#039;, which displays the last number in the stack, and &#039;&#039;&#039;SHOW&#039;&#039;&#039; which will display the entire stack.&lt;br /&gt;
* Add the standard math operations, &#039;&#039;&#039;+&#039;&#039;&#039;, &#039;&#039;&#039;-&#039;&#039;&#039;, &#039;&#039;&#039;*&#039;&#039;&#039; and &#039;&#039;&#039;/&#039;&#039;&#039;: These remove 2 numbers from the stack (the last number in stack is the first operand and the second last number is the second operand), perform the operation and appends the result back to the stack. You notice operand order matters for - and /. At this point we have a simple but functional calculator.&lt;br /&gt;
* Add single number operations &#039;&#039;&#039;LOG&#039;&#039;&#039; and &#039;&#039;&#039;SQRT&#039;&#039;&#039;, which replaces the last number in the stack with the log/square root of the number.&lt;br /&gt;
* Solidify your program by ensuring any operations first check if the required number of operands are on the stack before trying to perform the operation. Display &amp;quot;Not enough operands on the stack&amp;quot; and otherwise do nothing if the check fails. Hint: Maybe lists of zero, one and two operands commands could be useful.&lt;br /&gt;
* Add the commands: &#039;&#039;&#039;DROP&#039;&#039;&#039; which simply removes the last number on the stack, &#039;&#039;&#039;=&#039;&#039;&#039;, which removes the last number on the stack and displays it, &#039;&#039;&#039;SWITCH&#039;&#039;&#039;, which switches the last two numbers on the stack, and &#039;&#039;&#039;DUP&#039;&#039;&#039; which duplicates the last number on the stack, i.e stack consists of 1, after DUP it consists of 1 1.&lt;br /&gt;
* Add the commands: &#039;&#039;&#039;ABS&#039;&#039;&#039;, &#039;&#039;&#039;NEG&#039;&#039;&#039; which replaces the last number on the stack which the absolute/negative value of the number.&lt;br /&gt;
* At this point you can probably work out some mathematical operations to add that require one or 2 operands by yourself. I can think of the &#039;&#039;&#039;SIN&#039;&#039;&#039;, &#039;&#039;&#039;COS&#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;TAN&#039;&#039;&#039; operations, the &#039;&#039;&#039;INT&#039;&#039;&#039; taking the integer part of a number, &#039;&#039;&#039;EXP&#039;&#039;&#039;onential and &#039;&#039;&#039;SQUARE&#039;&#039;&#039;. Modulo operation with &#039;&#039;&#039;%&#039;&#039;&#039;. &#039;&#039;&#039;FAC&#039;&#039;&#039;torial. You could add constants like &#039;&#039;&#039;PI&#039;&#039;&#039; and &#039;&#039;&#039;E&#039;&#039;&#039; that simply puts an appropriate value on the stack.&lt;br /&gt;
* Add stack control with &#039;&#039;&#039;CLEAR&#039;&#039;&#039; to empty the stack and extend the &#039;&#039;&#039;SWITCH&#039;&#039;&#039; to switch the numbers as two given position like &amp;quot;SWITCH 2 4&amp;quot; if given positions.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Functions&amp;diff=264</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Functions&amp;diff=264"/>
		<updated>2025-10-03T13:56:25Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[List manipulation]]&lt;br /&gt;
|Next: [[Simple pattern matching]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_08-Functions.ppt Functions]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f509116f-48e5-445b-bf6e-af27012ba23f Functions in Python] Monday&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=21e9d4d0-2ba5-465c-9939-af27012b7a7e Examples and identifying data types] Monday&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
Resource: [[Example code - Functions]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e7b18282-7fb8-4c25-bd69-af27012adf7b Live Coding] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
* Functions: a function is both a way of hiding complexity and a way of reusing code.&lt;br /&gt;
* Arguments, scope of variables.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
Any function you are required to make here needs a small program around it to show that it works - so you also make that as part of your hand-in.&amp;lt;br&amp;gt;&lt;br /&gt;
The exercises 5 to 8 belongs together as a group and should be solved in order. They are about reading, changing and writing fasta files with many entries. You will likely find 5 especially hard.&lt;br /&gt;
&lt;br /&gt;
# The [https://en.wikipedia.org/wiki/Hamming_distance Hamming distance] is the distance between two strings of &#039;&#039;&#039;equal&#039;&#039;&#039; length. Make a function which takes two strings as arguments and calculates the distance between them. Add error handling.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a function &#039;&#039;&#039;fibonacci(no1, no2, count)&#039;&#039;&#039; which calculates the first &#039;&#039;&#039;count&#039;&#039;&#039; [https://en.wikipedia.org/wiki/Fibonacci_number fibonacci numbers] based on &#039;&#039;&#039;no1&#039;&#039;&#039; and &#039;&#039;&#039;no2&#039;&#039;&#039; and returns them in a list. The next number in a fibonacci sequence is the sum of the two previous numbers. Test it with printing the resulting list (one number per line) from fibonacci(0,1,20).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a function that returns the unique elements of a list as a list. Try it on the accession numbers in &#039;&#039;ex5.acc&#039;&#039;, which contains 6461 unique accessions, but also make your own file with simple numbers.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;Make a function that calculates the standard deviation of a list of numbers. Try with the file &#039;&#039;ex1.dat&#039;&#039;, where you pool all the numbers in the the 3 columns into one list and get the result 1.8355. You can either do the two-pass algorithm (iteration through all the numbers twice) which is clear from the formula or the one-pass algorithm which you can derive from the formula if you are up to the challenge.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt; [[File:StandardDeviation.gif]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Look at the fasta file &#039;&#039;dna7.fsa&#039;&#039;. It contains several fasta entries. Reading more than one entry in a file is more complex. Make a program that mostly consists of one function &#039;&#039;&#039;fastaread(filename)&#039;&#039;&#039; which takes a filename as a parameter and returns 2 lists, first list is the entry headers, second list is the entry sequences (as single strings without whitespace). Add appropriate error handling to the function. Just print the headers and sequences out pairwise as proof of concept. &amp;lt;br&amp;gt;Hint: I will point out that the reading and writing of fasta files with many entries is a regular occurrence in bioinformatics (and exam), so be sure to get it right. Many people mistakenly believe that they should use a form of stateful parsing with a flag for this - doing so confuses the issue, so abstain from that.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a function &#039;&#039;&#039;fastawrite(filename, headers, sequences)&#039;&#039;&#039; which takes a filename, a list of headers and a corresponding list of sequences as parameters and writes a fasta file with that file name. Add appropriate error handling to the function. You can test your function using the file &#039;&#039;dna7.fsa&#039;&#039; and your previous function - reading &#039;&#039;dna7.fsa&#039;&#039; and then writing a new fasta file, should make the files identical.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a function that take a DNA sequence (string) as parameter and return the complement strand (reverse complement). Make the function generic and portable, i.e. not dependent on any external factors. Together with the functions you made in exercise 5 &amp;amp; 6, read the fasta entries in file &#039;&#039;dna7.fsa&#039;&#039; and write the complement strands in the new file &#039;&#039;revdna7.fsa&#039;&#039;. Add &#039;Complement strand&#039; to each header.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a function that calculates the GC-content of a DNA sequence. It takes a DNA (string) as parameter and returns the GC percentage. Make the function generic and portable, i.e. not dependent on any external factors. Together with the functions you made in exercise 5 &amp;amp; 6, read the fasta entries in file &#039;&#039;dna7.fsa&#039;&#039; and write only the sequences which has a GC-content percentage over 50% in the new file &#039;&#039;dna7GC.fsa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* Make a function that calculates the factorial. Add some input control to the function to make sure you get positive integers, when you ask for a number. Consider if you want to raise an exception if the function gets invalid data or you want to halt the program.&lt;br /&gt;
* Make the factorial function computation use recursion.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=List_manipulation&amp;diff=263</id>
		<title>List manipulation</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=List_manipulation&amp;diff=263"/>
		<updated>2025-10-03T13:55:41Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Stateful parsing]]&lt;br /&gt;
|Next: [[Functions]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_07-Lists.ppt List manipulation] Pretty comprehensive (read long).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=871af158-9477-47c6-8e89-af27012d6e8d The basics of lists in python]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e3b143a8-962c-40ee-bd10-af27012d502c Working with lists, modification]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
Resource: [[Example code - Lists]]&amp;lt;br&amp;gt;&lt;br /&gt;
Resource: [[Example code - Lists and enumerate]]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=0d134a6c-ec9b-46d0-8a62-af27012bf0ef Live Coding]&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
Lists and list methods.&amp;lt;br&amp;gt;&lt;br /&gt;
List algorithms.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
# Searching for accession numbers. In the file &#039;&#039;ex5.acc&#039;&#039; there are 6461 unique GenBank accession numbers (taken from HU6800 DNA array chip). An inexperienced bioinformatician unfortunately fouled up the list, so many of the accession numbers appears more than once. Make a program that first reads the file into a list, then ask for an accession number and counts how many times it appears in the list and displays the result. Keep asking and searching for accession numbers until STOP is entered. Hint: this is 2 loops inside one another.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;You need to clean up the &#039;&#039;ex5.acc&#039;&#039; file. The first step is to sort the accession numbers alphabetically. You must program a sorting algorithm. There are many different algorithms for sorting, but let&#039;s pick a simple one - Bubble Sort.&amp;lt;br&amp;gt;It goes like this. Read the accessions into a list like the previous exercises. Go through the list looking at pairs of accessions (at position i &amp;amp; i+1). If a pair is in the wrong order, you switch them. Repeat going through the list until you have gone through the entire list without switching once. Now the list is sorted and you save the list in the &#039;&#039;sorted5.acc&#039;&#039; file.&amp;lt;br&amp;gt;Note: &#039;&#039;&#039;It takes 10-30 sec to run this program&#039;&#039;&#039;. There is room for optimization in the described algorithm and it is in any case not the most efficient method. Strings can be compared directly with each other using the operators &amp;lt;nowiki&amp;gt;==, !=, &amp;gt;, &amp;lt;, &amp;gt;=, &amp;lt;=.&amp;lt;/nowiki&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# It is now time to find the unique accession numbers, so you only have one of each - no duplicates. Read the accessions from &#039;&#039;sorted5.acc&#039;&#039; into a list. Since the list is now sorted, the duplicates are &amp;quot;next&amp;quot; to each other, which makes them easy to find. Make a &#039;&#039;&#039;new&#039;&#039;&#039; list with the unique accessions from the old list, and save that list in the file &#039;&#039;clean5.acc&#039;&#039;. Check that you have 6461 accessions, one per line.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In this exercise you have to do the same and achieve the same result in a different way as the previous exercise. Instead of making a new list with the unique accessions, just keep the old list and remove the duplicates. You can use &#039;&#039;&#039;del&#039;&#039;&#039; or &#039;&#039;&#039;pop&#039;&#039;&#039; to remove elements. If you run into trouble imagine your code executed on this list: [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# First ask for some input file names. Do this a either a loop where you ask for one file name at a time until empty string is entered, or all file names on a space separated string. You must compute the sum of the first number in all files, the sum of the second number in all files and so forth. Save the sums in the output file &#039;&#039;sums.dat&#039;&#039;. The input files may be corrupted or not the same length. Deal with that by assuming a corrupted line (a line you can not convert to a number) and missing lines in short files are 0. The files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039;, &#039;&#039;ex1_3.dat&#039;&#039; and &#039;&#039;ex1corrupt.dat&#039;&#039; are good for testing.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# After having looked at the cleaned accession numbers in &#039;&#039;clean5.acc&#039;&#039;, you will have seen that the accession numbers are sorted. This means that you can use the much more powerful binary search method when searching for accession numbers. Make a program that reads the file and repeatedly asks for accessions and searches the list (and tells if it is there or not) using binary search until you enter STOP instead of an accession.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Make a program that calculates the sum of all columns in an input file, no matter how many columns there are. Each column should be summed individually. You can assume that each row (line) has the same number of columns in the file. In the file &#039;&#039;ex1.dat&#039;&#039;, the sums of the three columns are: -904.4143, 482.8410, 292.0515&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;#AA00FF&amp;quot;&amp;gt;Make a Python program that can select specific columns from a column based (tab separated) file and save them in a new file. It should select the columns that you specify in the order you specify. Ask for input and output file names and column numbers (3 questions, example &amp;quot;ex1.dat&amp;quot;, &amp;quot;2col.acc&amp;quot; &amp;amp; &amp;quot;3 1&amp;quot;). The program should work with any number of columns in the input file.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* Read a file with numbers into two lists. The first number in the file goes to the first list, the second number to the second list, the third number to the first list, and so forth - alternating numbers to alternating lists. Compute the sum of the two lists and display. Files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039; are good to use for this.&lt;br /&gt;
* Now compute the same sums - without the lists :-)&lt;br /&gt;
* Ask for files names and read the numbers in the file into a list. Continue to ask for file names and add the numbers to the list until you enter STOP. Your list of numbers will simply grow with each file you add. Now compute the sum of the numbers in the list and display the result. Files &#039;&#039;ex1_1.dat&#039;&#039;, &#039;&#039;ex1_2.dat&#039;&#039; &amp;amp; &#039;&#039;ex1_3.dat&#039;&#039; are good to use for this.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Stateful_parsing&amp;diff=262</id>
		<title>Stateful parsing</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Stateful_parsing&amp;diff=262"/>
		<updated>2025-10-03T13:55:07Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Exceptions and bug handling]]&lt;br /&gt;
|Next: [[List manipulation]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22101/22101_08-StatefulParsing.ppt Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=fe50507e-9009-49b1-a3a8-af27012d8cdf Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=ce785005-14cd-424a-a406-af27012b3e1b Finding errors with Stateful Parsing]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=acd48c9a-cacb-4832-9184-af27012c7021 Live coding]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
Using stateful parsing to extract data spanning several lines, by recognizing keywords.&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
The following 5 exercises deal with SwissProt. The file sprot1.dat is a SwissProt database entry. Study it carefully. Locate the SwissProt ID (SP96_DICDI), the accession number (P14328) and the amino acid sequence (MRVLLVLVAC....TTTATTTATS). There are other entries ( &#039;&#039;sprot2.dat&#039;&#039;, &#039;&#039;sprot3.dat&#039;&#039;, &#039;&#039;sprot4.dat&#039;&#039;). Your programs should work on those, too. Also your programs must solve all the problems in ONE reading of the file. It is acceptable if you just hand in one program that solves 1 to 4. 5 is separate. These exercises are about studying and understanding the file format.&lt;br /&gt;
&lt;br /&gt;
# Make a program that reads the ID and prints it. Try to use the &amp;quot;walk the line&amp;quot; technique.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Add the following functionality to the program: Read the accession number and print it. Again, walk the line.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;Add the following functionality to the program: Read the amino acid sequence and print it. You really should use stateful parsing in this exercise. Maybe check the video.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Add the following functionality to the program: Verification of amino acid number. This means extract the number from the SQ line (example: SQ SEQUENCE 629 AA;) and check that the amino acid sequence has that number of residues. It should be the program that determines if something is wrong - not the user. Imagine that before you go home, you set the computer to run through a million swisprot entries. The next day, you must be able to see what failed. In a sense you don&#039;t care about what succeeded, as that is the common case. You care about what failed, because it is here you must take action.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Now that you have the ID, accession number and AA sequence save it to a file &#039;&#039;sprot.fsa&#039;&#039; in FASTA format. Look in the file &#039;&#039;dna.fsa&#039;&#039; for an example of FASTA. Notice the first line starts with &amp;gt; and immediately after comes an unique identifier, like an accession number or a SwissProt ID. Any other data must be on the header line only, but in free format. Sequence data is on the following lines. &amp;lt;br&amp;gt;Notice that this exercise incorporates the previous 4, but uses the result in a slightly different way.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# In reality you never have just one entry in a SwissProt file. The current SwissProt database contains more than half a million entries and it grows all the time. A bioinformatician can access the database by selecting a subset or the whole database as one file for download and extract the needed information from it. In the file &#039;&#039;sprotall.dat&#039;&#039; the 4 sprot files have been collected as a very small example of what you really meet. The exercise is to read all entries in &#039;&#039;sprotall.dat&#039;&#039; and create one fasta file &#039;&#039;sprotall.fsa&#039;&#039; with the ids, accessions and sequence for all entries. In short, just like the previous exercise but for a file that contains more SwissProt entries. And please, don&#039;t do anything stupid like reading the entire file into a list and start parsing that. These SwissProt excerpts can get really big and it can kill your computer memory doing that.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* Count the number of RA (Author) lines in the &#039;&#039;sprot1-4.dat&#039;&#039; files. &#039;&#039;sprot2.dat&#039;&#039; contains 25 RA lines.&lt;br /&gt;
* Extract the author names from the RA lines in the &#039;&#039;sprot1-4.dat&#039;&#039; files. Display the names - only the names.&lt;br /&gt;
* Continuing previous exercise: Now also extract the title (RT lines). Display like title first on one line, followed by authors on the next. Then empty line followed by the next title and authors and so forth, until no more authors/titles.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Exceptions_and_bug_handling&amp;diff=261</id>
		<title>Exceptions and bug handling</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22116/index.php?title=Exceptions_and_bug_handling&amp;diff=261"/>
		<updated>2025-10-03T13:54:29Z</updated>

		<summary type="html">&lt;p&gt;WikiSysop: /* Exercises to be handed in */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| width=500  style=&amp;quot;font-size: 10px; float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[String manipulation]]&lt;br /&gt;
|Next: [[Stateful parsing]]&lt;br /&gt;
|}&lt;br /&gt;
== Required course material for the lesson ==&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_05-Exceptions.ppt Exceptions and bug handling]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=d230fcd7-c06c-414e-a14d-af27012e22f6 Exceptions]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=d2136eb3-c9cb-414d-a0dc-af27012daa40 Exceptions example code]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=149168ad-61c5-4ad6-bad0-af27012e0077 Formatting data]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=08e7ed65-afe3-4f53-9d21-af27012de2bf Comparing many values]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=1255c184-8256-41d9-afc0-af27012dc955 Finding errors in your program]&amp;lt;br&amp;gt; --&amp;gt;&lt;br /&gt;
Resource: [[Example code - Exceptions]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=acd48c9a-cacb-4832-9184-af27012c7021 Live coding]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Subjects covered ==&lt;br /&gt;
How to structure your code in distinct parts.&amp;lt;br&amp;gt;&lt;br /&gt;
Finding bugs in your program, using &#039;&#039;exceptions&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exercises to be handed in ==&lt;br /&gt;
# In the file &#039;&#039;dna.fsa&#039;&#039; is some DNA. Construct a program that finds possible translation starts :-)&amp;lt;br&amp;gt;All proteins start with the amino acid methionine (at least when translating, Met might be removed in later processing states). Methionine is coded with ATG. The exercise is therefore; find the position of all ATG&#039;s in the sequence. The first position is 83 as humans count. &amp;lt;br&amp;gt;In some organisms different start codons are possible. If you really want to, you can make the program handle those cases too.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Connecting to the previous exercise; Assuming that the first Met at position 83 is translation start, find the corresponding translation stop (which is the first one in frame). Stop codon is coded by TAA, TAG, or TGA. Remember that the stop codon has to be in the same reading frame as ATG. Notice: There are two ways to solving this exercise. The primitive way is to start at the position given. The more general and better way is to find the first ATG and then find the corresponding stop codon, which is on position 128.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Read the file &#039;&#039;orphans.sp&#039;&#039; and find all accession numbers (and only the accession numbers), save them in another file of your choosing. Hint: an accession number might look like this AB000114.CDS.1 or like this AB000114 or like this AB000114.CDS.3. CDS means CoDing Sequence followed by a number. If the accession number contains the CDS part, consider .CDS.1 as a part of the accession number. Accession numbers differ in length for historical reasons. You can assume that the accession number comes straight after the &#039;&#039;&#039;&amp;gt;&#039;&#039;&#039;, which is first on the line.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# &amp;lt;font color=&amp;quot;AA00FF&amp;quot;&amp;gt;Make a program that asks for an organism, like &#039;HUMAN&#039; or &#039;RAT&#039;. The program should then count the number of lines/times a SwissProt identifier in the file &#039;&#039;orphans.sp&#039;&#039; is present with said organism, ie. PARG_HUMAN and LUM_HUMAN are the two first for HUMAN. Hint: you should probably think twice in this exercise. The position is significant. Check what happens if you search for RAT.&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# Count the ATCG&#039;s in the sequence in &#039;&#039;dna.fsa&#039;&#039;. Display the percentage of ATCG&#039;s with 2 digits after the dot. Make  it look really structured. Just to be exceedingly clear; the percentage of A&#039;s is 100*(NumberOfA/LengthOfSequence).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# The file &#039;&#039;studentweight.txt&#039;&#039; contains both text lines and numbers. Make a program that can ask for a file name and sum the numbers and ignore the text lines using exceptions. Result is 1035.&lt;br /&gt;
&lt;br /&gt;
== Exercises for extra practice ==&lt;br /&gt;
* In the file &#039;&#039;mixedlines.txt&#039;&#039; how many 4 letter words exists? A word is here defined as consecutive visible characters, i.e. &amp;quot;12&amp;quot;,  &amp;quot;ipsum.&amp;quot; are both words.&lt;br /&gt;
* Write a program that asks for an integer, and then determines if the number was a prime number or not.&lt;br /&gt;
* Write a program that prints a &amp;quot;bulls-eye&amp;quot; to the screen using characters like; &#039;.&#039;, &#039;+&#039;, &#039;*&#039;, &#039;#&#039;, etc.&amp;lt;br&amp;gt;You have to import the math library, in order to access the squareroot (sqrt), sine (sin), cosine (cos), and so forth functions. The square root of x is gotten like math.sqrt(x). I only used: for, if, elif, print, +, -, /, **, int, sqrt for this 40x40 example.&amp;lt;br&amp;gt;Hint: Think of a grid where one point is the center of the eye/circle. The positions in the grid will use different chars, depending how far away they are from the center. You might get an oval shape - think about why.&amp;lt;br&amp;gt;[[File:BullsEye.png]]&lt;br /&gt;
* Make a small program that asks for input - any input. It should output 1 of 3 simple lines:&amp;lt;br&amp;gt;1) You gave me a string&amp;lt;br&amp;gt;2) You gave me a number&amp;lt;br&amp;gt;3) You gave me a floating point number&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>