Skip to content

Latest commit

 

History

History
131 lines (89 loc) · 3.24 KB

File metadata and controls

131 lines (89 loc) · 3.24 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

Lab 2

We will practice collections, file handling, the use of various function parameters, generators, etc.

The script where you can gradually add your code is available here: ex_02.py.The script for working with files is available here: ex_02_files.py. An additional file, cities.txt, is also required for this script.

Exercise 3

Exercise 4

Exercise 5

Exercise 6

Exercise 7

Exercise 8

Exercise 9