Skip to content

FireStormHR/python-concepts

Repository files navigation

python logo pluys text

By Timo van Werkhoven

Welcome to the exercise project of the python course

Here we can put all discussed topics to the test. Whenever you get stuck at an exercise, make sure to check out the tips section in this md below.

Installation

To edit and run this project, you can undertake the following steps

  1. Install Python, at least v3.9, make sure Python get added to the system PATH (checkable option during installation wizard).
  2. Download this project to your machine, press the green code button followed by Download zip. Unpack the Zip afterwards.
  3. Download an editor/IDE, many good options. If no personal preference, VScode is recommended.
    1. Open VScode, select open folder, select the unpacked Zip from step 2
    2. Install the following extensions Ctrl + Shift + x.
      • autopep8
      • intellicode
      • powershell
      • pylance
      • python
    3. Link the downloaded python Interpreter to VScode by doing: Ctrl + Shift + p -> Python: select interpreter and select the interpreter which is likely at %user%\AppData\Local\Programs\Python\Python311
  4. Open a terminal and check if py is callable py --version. (In VScode an integrated terminal is available Ctrl + Shift + `)
  5. Ready to exercise! Go to the exercise file of your choosing, look at the jokingly title and tasks and fill in the blanks between the below and above code. Everytime you want to try out an exercise enter in the terminal: py app.py

Tips for exercises

Exercise 1

View it as a cabinet with documents. The '=' sign is telling everyone: 'At this location ive named myself I will put this bit of information'. So for example: drawerB = 5.

Exercise 2

When googling a solution for this task, changing the type of a value is often called parsing or casting. For checking if the type-changing code worked, you need to use a try-except block (so not an if).

Exercise 3

This is more a show and tell. The missing code is only one line.

Exercise 4

When trying to determine what the code should do, keep in mind there can also be spaces after the x-es.

Exercise 5

Keywords to search for when googling are class, constructor, attribute, method.

Exercise 6

Just removing the line myCar.colour = 'geel' is not an option. How do we make sure both variables are not related?

Exercise 7

The keyword def is vital here. Try and create code resulting in the ifelse block only being present once.

Exercise 8

The keyword to google for is function parameter.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published