flâneur — a map of the web's best reading

OxRSE Training

train.oxrse.uk · 1,243 words · saved by 1 readers

Comments make programs easier for humans to understand, good code is written for humans to read, not just for computers to execute. We have used functions already --- now let's take a closer look. An argument is a value passed into a function. Functions can take any number of arguments, including zero. len takes exactly one. int, str, and float take one (and return one). print takes zero or more. print with no arguments prints a blank line. print with no arguments prints a blank line. Function calls must always include the parentheses, even if they're empty, so that Python knows a function is being called. produces this output: Every function call produces some result but not every function returns something. If the function doesn't have a useful result to return, it usually returns the special value None. None is a Python object that stands in anytime there is no value. Use max to find the largest value of one or more values. Use min to find the smallest. Both work on character strin

Built-in Functions and Help: OxRSE Training Skip to main content Built-in Functions and Help "Programming with Python" course by the Carpentries Built-in Functions and Help Learning outcomes Using built-in Functions and Methods. Understanding syntax and runtime error messages. Use comments to add documentation to programs Any text preceded by the hash mark ( # ) is ignored by Python, this is called a "comment". Copy # This sentence isn't executed by Python. adjustment = 0.5 # Neither is this - anything after '#' is ignored. Comments make programs easier for humans to understand, good code is w

Explore this link on the map →

related reading