Programming 1

Cards (10)

  • The line of code "len()" is used to count the number of characters in a string.
    This includes spaces
  • The line of code "str.capitalize()" returns a string with the first character capitalised.
  • The line of code "str.title()" returns a string with the first letter of each word capitalised.
  • The line of code "str.swapcase()" swaps the case (lower to upper or vice versa)
  • Subroutines have two categories, procedures and functions.
  • A procedure executes a set of commands when it's called.
    (procedures do not return a value.)
  • A function calculates or processes a value based on arguments given
  • Functions can be called upon multiple times in a code once written.
  • A return value is a value which is returned by a function
  • A parameter is used in a subroutine to allow values to be passed into them.