Skip to main content

Python Primer

image Fundamentals and practice in Python.

  • using Spyder
  • run Spyder from Anaconda Navigator

Functions

  • Calling of functions
def hello():
"""Print "Hello World" and return None. This is docstring, and can be called by help(hello) from the Console."""
print("Hello World")

# Main program starts here
hello()

  • this way the function is defined for the Console and can be called again
  • sessions
  • visibility in current namespace
  • Ctrl+I information about function
  • function needs to be run to update, saving file is not enough
  • F5 to run, F9 to run selected function

Working with sources

Working with datafiles

note

Goals.

info

Goals.

caution

Goals.

warning

Goals.