Wrap Up

Dr Andy Evans

[Fullscreen]

Special types

  • Objects and operators built into the language but used only in modules:
  • Ellipsis (also "..."): used chiefly in slices in modules like numpy.
  • @ Used as an operator in some maths packages.

Type annotations

  • Only at class and module level
    def ascii_char(num: int) -> str:
        return chr(int)

  • These give the appearance of manifest typing, but can be checked only by outside code-checking software.

Efficiency

Python 2 to 3

Other languages

  • C++ / C / Java / JavaScript / C# / VB.Net / Scala: "C" Family. Broadly speaking more formal languages than Python, with more restrictions to prevent errors including manifest typing. Typical Java:
    import java.util.Vector;
    public static void main (String args[]) {
        Vector v = new Vector();
        double sum = 0;
        for (int i = 0; i < 10; i++) {
            double a = Math.random()*10.0;
            sum += a
            v.add(a)
        }
        System.out.println("sum = " + sum);
    }

Other useful languages:

  • In vague order of usefulness:
    JavaScript (Web programming)
    PHP (Backend web processing)
    Java (General programming; Android)
    C++ (General programming; joining the godhead)
    C (Hardware programming)
    R (Statistics)
    VBA (Visual Basic for Applications)
    VB.Net / C# (Windows programming)
    Perl (Largely superseded by PHP)
    Swift / Objective C (Mac programming languages)
    Ruby (More OOP Python-like language)
    MatLab (Maths processing)
    Fortran (frequently used for mathematically intense science)
    (...though there's no good reason for it)
    Prolog (Logic programming)
    Groovy / Scala (Python-like language / Java-like language that run on the Java platform)
    Lisp / Haskell (Semi-historical lambda-based/functional languages)
    Smalltalk (Semi-historical OOP language)

Further information

Other info

Main thing

  • Practice!