Skip to content

Latest commit

 

History

History
130 lines (89 loc) · 3.09 KB

exercises_en.md

File metadata and controls

130 lines (89 loc) · 3.09 KB

Labs

Lab 1

The script to which you can gradually add the code is available here: ex_01.py. The solution is available in: ex_01_solution.py.

We will discuss the following topics in the exercise:

  • Dynamic typing

  • Garbage collector

  • Working environment:

    • ipython
    • Magic command,% hist
  • Basic data types:

    • numbers (int, long, float, complex)
    • string:
      • immutable
      • literal for long string
      • encoding (prefix u)
  • list, tuple

  • dict

  • Singletons: None, True, False

  • Syntax basics:

    • Comments (+ docstring)
    • Assignment to a variable
    • Calling functions
    • print (basic {} substitution)
    • Conditions (possibility to bypass the absence of the switch)
    • Cycles:
      • for
      • while
    • Function definition

Recommended for practice:

A script from the 2011/2012 academic year that also includes recursion: ex_01_extended.py. (solution: cv1_labs_extended_full.py).

Exercise 2

Exercise 3

Exercise 4

Exercise 5

Exercise 6

Exercise 7

Exercise 8

Exercise 9