26 Matching Annotations
  1. Oct 2018
    1. Python math module

      Prepare example of using math modul! secondprogram.py A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended.

    2. Computer science

      Edsger Dijkstra:

      Computer science is no more about computers than astronomy is about telescopes.

  2. Oct 2017
    1. while counter <= 10 and not done:

      This while loop finishes if counter > 10 or done equals True.

    2. algorithms require two important control structures: iteration and selection

      Python provides loop and conditional statements.

      Loop sttements:

      1. while loop
      2. for loop

      Conditional statements:

      1. if statement
      2. ifelse statement
    1. len

      len is a metod.

    2. lists are considered to be sequentially ordered

      Lists are naturally ordered by adding and removing elements.

    3. integer division

      Relation between operator // and %.

      a = (a // b) * b + a % b

    4. Assignment statements provide a way to associate a name with a value

      Variable = Expression

      An Expression is evaluated and the it's value (reference to an object) is assigned to a Variable

    5. called __add__ in Python

      The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y.

    6. len

      len(s) is built-in function

      Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).

    7. Collection

      Collection is an object that contains other objects.

    8. Python supports the object-oriented programming paradigm

      The main OOP concepts:

      1. an object as a model of a real object
      2. a class as a factory for objects or as a template that defines the structure of objects from this class and behavior of objects from this class
      3. an object as an instance of a class
      4. a method with or without parameters describes the behavior of instances
      5. calling or invoking method
    9. The return value is None.

    1. algorithms require constructs that perform sequential processing, selection for decision-making, and iteration for repetitive contro

      Programming languages provide control structures for sequential, conditional and iterative performing partial actions.

    2. data types

      Data type = set of values + set of operations.

      Data types are glasses for interpretation of binary data.

    3. Programming is the process of taking an algorithm and encoding it into a notation, a programming language, so that it can be executed by a computer

      This is programming in the narrow sense of the word. Programming in a broader sense contains also analysis of the problem, design the solution, testing, debugging, maintaining.

    4. Algorithms describe the solution to a problem in terms of the data needed to represent the problem instance and the set of steps necessary to produce the intended result

      Algorithm is a transformation of valid input data to corresponding otput data.

      Features of a good algorithms:

      Precision– the steps are precisely stated(defined).

      Uniqueness– results of each step are uniquely defined and only depend on the input and the result of the preceding steps.

      Finiteness– the algorithm stops after a finite number of instructions are executed.

      Input– the algorithm receives input.

      Output– the algorithm produces output.

      Generality– the algorithm applies to a set of inputs.

    1. two important areas
      1. The study of algorithms and data structures makes you better algorithmic problem solver.
      2. For algorithms implementation is used Python programming language. Review this language is not exhaustive. For more details I refer you to the parallel course Python Basics.
    1. seeing how different algorithms are designed helps us to take on the next challenging problem that we are given.

      There are general design techniques (strategies) for solving algorithmic problem:

      1. Brute Force
      2. Backtracking
      3. Greedy approach
      4. Dynamic Programming
      5. Divide and Conquer
    1. Python

      Python is object oriented language that is used in this course for algorithms implementation.

    2. abstract data type

      Abstract data type defines the actions that can be done with data without implementations. E.g. stack

  3. Sep 2017