Hello, this is a summary of the lecture where I forgot to hit the record button. Sorry for
that, but I'll give you a summary about the content of this lecture now. It's really just
about a few new types, and we're starting with Python in this lecture, and about how to do very
basic constructs, like basic operations and branching, and we'll also talk a little bit
about a very special data type, which is strings. Now, a program is really a sequence of definition
and command, so it's nothing else than a recipe, how to execute certain things. And the difference
between definitions and commands is that definitions are evaluated, and commands are executed by the
interpreter in a shell or by a compiler that depends on the programming language. But they
are always converted into machine language, so these are processor instructions, really just
binary code, zeros and ones, that tell the processor what to do, where to look things up in memory,
where to move memory, and all of these sort of things. And commands, in contrast to definitions,
are statements that instruct the interpreter or compiler or the processor to do something.
So, and these, both of them, they can basically be typed directly into the shell, so especially
in Python, you can just run Python in your terminal, and then you get a Python shell.
Or what's more common is that they are stored in a file, and then you can run this file with
Python file, and it will run all the commands and definitions in this file for you. So,
this is then evaluated. What we also do in this lecture is we use Python Jupyter Notebooks,
so like in Google Colab, which is a little bit in between, but basically you can imagine it like
a file that is handed over to the interpreter and evaluated. Now, here, as I said already,
we'll focus on Python. It's really one of many programming languages, but it's very popular
right now for data science and other applications. We are just to explore the space. Python became
very popular recently because it is very easy to use, and for everyday tasks and simple things,
it's really very, very powerful, and it's, of course, free and open source, and everybody
can use it to whatever they like to use it. It's probably not the language of choice if you want
to implement something that's meant to be highly performant and very, very fast, applications that
run directly from your desktop, like here PowerPoint is probably not written in Python,
but technically you can convert Python code into more efficient code. It will just never be as
efficient as if you run it. Nowadays, with current computers, for most of the tasks,
it doesn't really make a difference, and you can solve basically everything within reasonable time.
Python is an interpreter language. It is not compiled in contrast to C or C++. Java is
somewhere in between. It's compiled for a very specific virtual architecture, but here in this
case, we are just interpreting directly. Other interpreter languages are Matlab. You might have
seen Perl or all of these sort of things. As I said already, it's either through
shells or notebooks, and we're going to use this language. Really, the key takeaway here is whatever
you learn in one language, in one imperative programming language, like the ones we are looking
in this course, these concepts are transferable to any other language. The only thing you have to
learn or rather say look up in the manual is the specific syntax that's required for that programming
language and potentially other quirks to make things more efficient or to make things more
elegant. The basic concepts we are discussing here are all transferable between imperative programming
languages. There are also functional programming languages, something like Haskell or
SML or these sort of languages. They are not part of this course simply because
we are more concerned with imperative languages because it's probably 90% of the use cases you use
in an imperative language. Nevertheless, anything you can do with an imperative language, you can
also do with a functional programming language. Functional languages you would probably
more use for proofing things, for symbolic reasoning and things like that.
So programming languages, you cannot absorb the knowledge about programming or even
about the individual languages by passively listening to me. Really, what you need to do
is practice, practice, practice, sit down and work with that language. There's nothing better than
learning by doing. Your best friend is the internet. There's Google, there's Stack Overflow,
there's probably an answer for every question you could come across while doing.
Presenters
Zugänglich über
Offener Zugang
Dauer
00:41:06 Min
Aufnahmedatum
2023-11-13
Hochgeladen am
2023-11-13 10:16:06
Sprache
en-US
python