Intro to Python
Mende Najdov
programmer ordinaire.
- 12 Years of experience
- I love sports, D&D, coding
- I play volleyball, soccer and video-games
- I'm Local and organic
- http://mende.najdov.com
Not this one...
This one.
Getting to know you!
educationally.
I know what a variable is.
I know how logical statements work.
or
(I don't not know how it works)
I know what a for loop is.
I know what a for loop is.
lol
I know what a function is
I've used other programming languages
I know what object oriented means.
I have made a program before.
It doesn't matter if it was just a webpage for your buddy's band.
I understand how to make money using bitcoins.
please see me after class.
What's a programming?
The source code of a program is written in one or more languages that are intelligible to programmers, rather than machine code, which is directly executed by the central processing unit.
Computer programming is the process of designing and building an executable computer program for accomplishing a specific computing task.
Programming involves tasks such as analysis, generating algorithms, profiling algorithms' accuracy and resource consumption, and the implementation of algorithms in a chosen programming language(commonly referred to as coding).
WALL OF WORD!
Do things.
Use data, logic, reasoning and math to do cool stuff.
Statements.
Tell the computer to do things.
What is a statement?
- an instruction
- assign a value
- check a value
Variables
learning = true
What are they good for?
- store information
- retreive information
In our previous example
print('hello Angela')
print('hello Doug')
print('hello Mende')
name = "Angela"
print('hello ' + name)
name = "Doug"
print('hello ' + name)
name = "Frank"
print('hello ' + name)
Wait...that seems worse?
Boolean Logic
It's not just for breakfast.
George Boole
He worked in the fields of differential equations and algebraic logic, and is best known as the author of The Laws of Thought (1854) which contains Boolean algebra. Boolean logic is credited with laying the foundations for the information age.[3]
November 1815 – December 1864
It's a system of thinking about truth
myAge = 37
yourAge = 17
myName = 'Mende'
yourName = 'Debbie'
myAge < yourAge # false
myAge > yourAge # true
myAge == yourAge # false
myAge != yourAge # true
myName == yourName # false
MAX_AGE = 100
myAge + yourAge < MAX_AGE
Looping
I've got 99 problems and i'll loop 'till they're done.
Why loops?
- Saves repetition
- It's much easier to read the code
Why not loops
Let the data be your guide. Not all data is ideal for looping over. Some sets of data require very unique treatment and in those scenarios, a loop won't help much.
LoooOOOooops
Functions
bringing it all together
name = "doug"
print('hello ' + name);
names = ["Simone", "Doug", "Ian", "Sarah"]
def printHello(name):
print('hello ' + name)
for name in names:
printHello(name)
Class
OOPs i did it again.
Intro to Python Programming
By Mende Najdov
Intro to Python Programming
- 383