The main function is where a program starts. When you run python3 example.py, it will run the code in the main function, including any function calls.

Running python3 example.py Brandon causes the string “Brandon” to become something called an argument. You can access arguments in the main function. All arguments are naturally taken in as a string. In order to have an argument be more than one word, use quotations.

import sys

def main():

args = sys.argv[1:]

print(args)

sys.argv is a list of all args which is [example.py, Brandon].

args is just [Brandon]