Aaron Hall β™‘'s 🐍, πœ†, & πŸ‡ΊπŸ‡Έ Profile picture
DM me! RT = See this & Like = Thx 4 posting! #Rstats #Python #Emacs #Haskell #Finance #Jesus NYC, πŸ‡ΊπŸ‡Έ
7 Feb 18
High level #python #tutorial thread:
Python is a high level language that runs bytecode in its virtual machine.
Everything is an object.
It supports OOP up to multiple inheritance and functional programming.
Typing is polymorphic - duck typing is preferred
A Python script is a file with a name like name.py - we indent at four spaces (it matters), comments (after #) don't execute - and is typically written like:

def main(): # function
print("Hello world")

if __name__ == '__main__': # then entry point
main()
A module is a reusable script:

"""this is a docstring at the top of the module - gives help on the module"""

import this # do imports at the top

def main(): # main at top or bottom
"""functions get docstrings too"""

if __name__... always at the bottom, assumed from now on
Read 68 tweets