Python Intro
Original Presentation by Grace (last year’s VP)
Adapted a bit by Elliott
What is Python?
How do I install Python?
If you have a school Chromebook:
Or, switch to a Dell/bring a personal computer!
Alternative solutions: use an online Python compiler
Otherwise:
The basics
Using Python, variables, math, logic, loops, functions, and data structures
Using Python
← input
← output
On the terminal:
Running files:
Result:
Variables
→ prints “Alice Smith”
Math
+ ← addition
- ← subtraction
* ← multiplication
/ ← division
// ← integer division (truncates decimal place)
% ← modulo (remainder)
** ← exponent
Conditionals
Loops
Two types of loops: for-loops and while-loops
For loops:
While loops:
Functions
Data Structures
There are 4 main types of built-in Python data structures: lists (arrays), dictionaries, tuples, and sets.
← Arrays use [ ]
← Dictionaries use { }
← Tuples use ( )
← Sets also use { }
Data Structures: Lists
What is slicing?
Data Structures: Dictionaries
Data Structures: Tuples & Sets
Tuples:
Sets:
Libraries
Some last useful commands
Resources
Do your own research!
https://www.w3schools.com/python/python_intro.asp ← Python intro
https://codingbat.com/python ←excellent beginner Python practice
https://www.programiz.com/python-programming/online-compiler/ ← online Python compiler
https://docs.pwntools.com/en/stable/install.html ←pwntools, a CTF framework and exploit development library
Go solve challenges!