Python

From ScienceZero
Revision as of 11:26, 2 October 2017 by Avi (Talk | contribs)

Jump to: navigation, search

Application

File Header

#!/usr/bin/python

Comments

These begin with the # character

Libraries

Subroutines

These must be placed at the top, under the file header and library includes

def functionname(value):
	#do something
	return somevariable

Variables

There is no method to define a variable type, it is determined by the type of the first value it gets set to
a = 42 will create an int called a with value 42