Lecture 0 - Functions, Variables
Lecture 0 - Functions, Variables
py
All we need at the end of the day is so-called text editor, a program for writing text
We just have to save it in a right format, all we need is a program for writing text,
because code is text
It will generate a file name that ends in .py to indicate to the computer that it’s
indeed a program
2. Python Interpreter +
We need to interpret that code from top to bottom, so the computer knows what to
do
The computer only understands 0 and 1, the so-called binary system, we need to
somehow translate the code to 0 and 1 to let the computer understand it
Python is known as interpreter that you install for free, and you can run that
program, that interpreter, passing to it as input (the name of file hello.py), the
program/interpreter will handle the process of reading it top to bottom, and
translate it to 0 and 1s, so the computer can understand
Function
Every language comes from predefined functions, it is a very basic action or verbs
that the computer already know how to do that for you
Argument
It is an input to a function that will influence the behavior of the function
Side Effect
This is the ultimate result of what the program doing on the screen
The functions can have these side effects
4. Bugs
Positional parameters
The first thing pass to print, it print that first, and the second one
Named parameters
You can print the text with double quotes like this
10. F-string
We need to tell python it is a format string
17. Division
18. Defining function
If you call a function, the function must exist by the time we call it