#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Preview of functions, modules, packages """ # %% Built-in function calls and help in python # named_block_of_code() is a function call. # Python3 has many pre-written for you. """ #!/bin/bash pydoc --help # search for help on topic pydoc -k topic """ help() help(help) help(print) help(int) help(list) # quit() quits the python3 interprete, # which we don't want to actually do right now. # Skip this line if you want quit() # %% Preview of Modules and Packages (more to come later) # import someone_elses_code # lets you use code written elsewhere on your computer. # Don't generally pollute your namespace with this: from math import * print(gcd(10, 5)) # do this instead! from math import gcd print(gcd(10, 5)) # this is good too. import math # This is dot (.) notation: math.gcd(15, 10) # It accesses a sub-function of the math module # Put these import statements at the top of your source code file, # not somewhere in the middle like this.