GoConqr has a new look! Let us know what you think.

Flashcards

String & List Manipulation (Gaddis Ch. 7-8)

Naomi j Steplight Misc. English 33 cards

Cards in this deck (33)

  1. 1methodself-operating function (performs an action on the list itself)
  2. 2append method'list.append(item)'
    Adds an item to the end of a list
  3. 3index method'list.index(item)'
    Returns the index of the first element that shows up containing 'item'
  4. 4insert method'insert(index, item)'
    Inserts an item at the given index
  5. 5sort method'list.sort()'
    Sorts the given list from smallest to largest
  6. 6remove method'list.remove(item)'
    Removes a given item from a list
  7. 7reverse method'list.reverse()'
    Reverses the order of items in a list
  8. 8operatorManipulates its operand(s)
  9. 9in operator'item in list'
    Returns 'True' if the item is in the list and 'False' if it is not
  10. 10del operator'del list[index]'
    Deletes whatever is at the given index of the given list
  11. 11functionPerforms an arbitrary operation on the supplied argument
  12. 12min function'min(list)'
    Built-in Python function that returns the smallest value in a list
  13. 13max function'max(list)'
    Built-in Python function that returns the largest value in a list
  14. 14len function'len(argument)'
    Returns the length of a string or list
  15. 15isalnum()Returns 'True' if the string contains letters and numbers and is at least one character long
  16. 16isalpha()Returns 'True' if the string only contains letters and is at least one character long
  17. 17isdigit()Returns 'True' if the string only contains numbers and is at least one character long
  18. 18islower()Returns 'True' if all of the letters in the string are lowercase and there is at least one letter in the string
  19. 19isupper()Returns 'True' if all of the letters in the string are uppercase and there is at least one letter in the string
  20. 20isspace()Returns 'True' if all of the characters in the string are whitespace characters (which include \n and \t)
  21. 21lower()Returns a copy of the string with all characters converted to lowercase (all non-letter characters remain unchanged)
  22. 22upper()Returns a copy of the string with all characters converted to uppercase (all non-letter characters remain unchanged)
  23. 23lstrip()Returns a copy of the string with all leading whitespace characters removed (which includes \n and \t)
  24. 24lstrip(char)Returns a copy of the string with all instances of 'char' that appear at the beginning of the string removed
  25. 25rstrip()Returns a copy of the string with all trailing whitespace characters removed (which includes \n and \t)
  26. 26rstrip(char)Returns a copy of the string with all instances of 'char' that appear at the end of the string removed
  27. 27strip()Returns a copy of the string with all leading and trailing whitespace characters removed (which includes \n and \t)
  28. 28strip(char)Returns a copy of the string with all instances of 'char' that appear at the beginning and end of the string removed
  29. 29endswith(substring)Returns 'True' if the string ends with that substring
  30. 30startswith(substring)Returns 'True' if the string starts with that substring
  31. 31find(substring)Searches for 'substring' within the string. If it is found in the string, it returns the lowest index. If not, it returns -1
  32. 32replace(substring, new_string)Returns a copy of the string where every instance of 'substring' is replaced by 'new_string'
  33. 33split methodReturns a list containing the words in the string

Information

Description
Misc. Flashcards on String & List Manipulation (Gaddis Ch. 7-8), created by Naomi j Steplight on 08/02/2018.
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?