Course number: 20253491
There will be assignments after every lecture. You will submit them via GitHub. I'll explain the details during the lectures.
Towards the end of the course you'll be asked to do a project. First you need to submit a proposal for the project and when it is accepted then implement it. The project should be something that is useful for your studies or at least it is fun for you to make. Ask in the lab where you work what needs are there that you might implement as your final project. You can get inspiration from the projects listed here and the projects of the 2023 autumn semester or those of 2024 spring semester.
In addition to the lectures you will spend about 2-4 hours / week on the assignments and 20-40 hours on the project.
The actual time spent will greatly depend on your previous experience with programming in general and Python in particular.
The time you spend on the project will also depend on the availability of the data you work on. If you pick a project that you would want to do anyway then this is basically time you would spend anyway.
Each assignment counts as 5% (we will have 10 of them).
The project proposal is 15%.
The project is 35%.
The project is a requirement. Without that you won't get a passing grade.
During the course I'll use some of the slides that can be found here. These slides are publicly available and will remain on the web site after the course is over.
There are recording of this course from 3 years ago.
There are also recordings from the 2023 autumn semester.
There are also recordings from the 2024 spring semester.
You can watch those, but be also warned, this semester the order of the material will be different.
There are many more videos in my English-language YouTube channel. You are invited to check them out and to follow the channel.
Some of the material is also available in Hebrew. You can find them on my website and in my Hebrew-language YouTube channel. You are invited to follow that channel as well.
The default teaching language of WIS and of this course is English.
In writing please stick to English.
If and when we have one-on-one conversions I'd be happy to speak in Hebrew, Hungarian, Spanish, or Ladino as well.
You are expected to bring your own computer to the lectures.
There is no need to install anything up front. We'll do that during the lectures.
GitHub, GitHub Pages
Self introduction
Overview of the course
Programming
Version control
GitHub pages
Parts of a computer
If you don't have one yet create an account on GitHub.
Upload a picture of you or some avatar to your account.
Create a nice page based on GitHub pages. Include information about yourself, your studies, your hobbies. Link to the institution and to my home page https://szabgab.com/ .
Open an issue on our repository, the title should be "1st assignment of YOUR NAME" (put your name instead of YOUR NAME) and in the issue link to your web site and to your repository.
The TAs will respond to the issue and I'll add a link to your site to the README of the repository of the course.
Dead-line: 2024.11.06 24:00
Install VS Code
Mention other IDEs (PyCharm, Spyder)
Write Hello World
Install Python
Run Python program
Mention Anaconda
Install Jupyter labs
Create first Notebook
Install Git client
Start a repo locally
Local setup
Add some files.
We ran out of time and I could not show how to connect the local repo and the one in GitHub. I should have done this and delay the Jupyter labs demo for the next session.
Star our repo.
Pick two participinats of the course who you don't know (preferably people who who don't yet have 2 issues opened on their repo), look at their web site, star their repo and open a constructive issue on how to improve the site.
Handle the issues you receive. (Comment on them and when both of you are satified with the changes then close the issue.
Write a python program that has two variables width
and length
of a rectangle. Print out the area and the circumference of the rectangle. (rectangle.py
)
Write a python program that has one variable radius
of a circle. Print out the area and the circumference of the circle. (cricle.py
)
Create a Jupyter Notebook that has 3 variables width
and length
of a rectangle and the radius
of a circle. Print out the area and circumference of both. (day2.ipynb
)
Create a new repository for the assignments (e.g. call it python-assignments) create a folder called day02 and upload the 3 files to that folder.
Add a README.md file to the root of the repository with some information explaining what is in the repository.
Open an issue on our repository "day 2 by YOUR NAME" and a link to the new repository.
Mention that in the course we only learn 0.01% of "programming in Python", the rest they will have to learn alone.
Mention the tension that about 30% of the students have no programming background and the other have.
Resize image: https://github.com/szabgab/wis-python-course-2024-11/issues/43
Clone web site
Make some changes to the web site
Commit and push
Create a new repository for the assignments. Clone it. Add some files and push it out.
Clone the repository of your assignments
Add a new folder called day03
Copy the rectangle.py
from day02 and change it to use input
to get the values from the user.
Copy the circle.py
from day02 and change it to use the command line to get values from the user. (argparse)
Copy the Jupyter notebook from day02 and change it to get the parameters using input
.
Copy the day03/dilution_calculation.ipynb
from this repository (you can clone this repository as well to your computer) and solve it.
Dead-line: 2024.11.26 22:00
Using Jupyter notebook
input()
scalar values (e.g. a number)
def
define functions
return single value
return multiple values and accept them as a tuple
move the function to a separate file and import
it from there.
lists
for
loop to double numbers
map
to double numbers
list
range
random
if
break
continue
divide 100 by numbers in a list
two lists (vectors) - add them pair-wise using a for loop and using zip
Show how to search for help - Stackoverflow
day04
.We did not go over the while loops but for this assignment you will need it. It is used when we don't have anything to iterate overknow or we don't know up front how many iteration we will have.
You can use break
and continue
in the while
loops as well:
You car write it like this:
while True:
if some_condition:
break
...
Write a Python program that is a number guessing game:
The computer "thinks" a about a whole number between 1 and 20
The user guesses
The computer tells if the guess was too small, too big or exact.
If exact the user wins, the program ends. Otherwise the user can guess again.
At the end of the game print out how many guesses the user needed.
Allow the user to play several games: once one game ends ask her if she wants to play again, generate a new random number and play again.
If the user enters "x" any time, exit the program.
If the user enters "n" any time, leave the current game and ask if she wants to play a new game?
If the user enters "s" any time, show the hidden number (cheating).
Move the code in a function called main
and split up the code into several function that make sense.
Dead-line: 2024.12.02 22:00