Difference between revisions of "Python"
From ScienceZero
(Created page with "insert stuff... Category:Computing") |
|||
| Line 1: | Line 1: | ||
| − | + | =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<br /> | ||
| + | a = 42 will create an int called a with value 42 | ||
[[Category:Computing]] | [[Category:Computing]] | ||
Revision as of 11:26, 2 October 2017
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