Python basic functions:

  1. The print() function: Prints a string
  2. The raw_input() function: captures characters from the user’s keyboard
  3. Len () function: calculates the length of a character
  4. Format (12.3654, ‘6.2F ‘/’0.3%’) function: implements formatted output
  5. The type() function: queries the type of the object
  6. Int () function, float() function, STR () function, etc. : type conversion functions
  7. The id() function: gets the memory address of the object
  8. The help() function: Python’s help function
  9. S.i slower function: Judge characters at lower case
  10. The s.space () function checks whether it is a space
  11. Str.replace () function: replace character
  12. The import() function: imports libraries
  13. Math.sin () : the sin() function
  14. Math.pow () function: Computes the power function
  15. 3 times *4: 3 to the fourth power
  16. Pow (3,4) : 3 to the fourth power
  17. The os.getcwd() function: gets the current working directory
  18. The listdir() function displays the files in the current directory
  19. Socket.gethostbyname () : gets the IP address of a host
  20. Urllib.urlopen (URL).read(): Opens web content and stores it
  21. The open().write() function: writes to a file
  22. The webbrowser.open_new_tab() function creates a new TAB and opens the specified web page using the browser
  23. Def function_name(parameters): a custom function
  24. The time.sleep() function: stop for a while
  25. Random.randint () function: generates a random number
  26. Range () function: Returns a list, printed from 1 to 100
  27. File.read () function: Reading a file returns a string
  28. The file.readlines() function: reads a file and returns a list
  29. The file.readline() function reads a line of file and returns a string
  30. Ords () and CHR (ASCII) functions: convert a string to ASCII or ASCIIIS\ to a string
  31. Find (s[,start,end]) function: finds s from a string
  32. Strip (), lstrip(), rstrip() functions: remove Spaces
  33. The split() function: What is used to split the string
  34. The isalnum() function checks whether it isa valid number or character
  35. The isalpha() function checks whether the range is full of characters
  36. Isdigit () : checks if all digits are present
  37. The lower() function: changes the data to lowercase
  38. Upper () function: uppercase data
  39. The startswith(s) function checks if the string startswith s
  40. The endWith (s) function checks whether the string ends with s
  41. File.write () function: write function
  42. File.writeline () function: writes to a file
  43. The s.append() function inserts data at the end of the data
  44. The s.insert(3,-1) function inserts data -1 before position 3
  45. The list() function converts a string to a list
  46. Index (value) : Finds the location of the first value in the data
  47. The list.extend() function extracts each piece of data and adds it to the list
  48. The count() function: The number of occurrences of an element in the statistics
  49. List.remove (” s “) : removes the first occurrence of s from the data
  50. Del list[2] deletes the second element of the data
  51. The pop() function: removes the data at the specified location, with a return value
  52. Remove (” ha “) function: removes the “HA” element from the original data
  53. The reverse() function: reverse of the list
  54. Isinstance () function: determines whether a data is of a certain type
  55. The abs() function yields the absolute value of a number
  56. Del x[2] deletes the element in list X with index 2
  57. File.sort () function: sorts book data
  58. The tuple() function creates a tuple
  59. The find() function: the search returns the index
  60. The join() function: the reverse operation of split
  61. {} : create a dictionary
  62. The dict() function: creates a dictionary
  63. The clear() function clears all entries in the dictionary
  64. The copy() function copies a dictionary, modifying all dictionaries
  65. D.c. opy() function: Copies a dictionary, only modifying the current dictionary
  66. The get() function queries elements in the dictionary
  67. The items() function returns all dictionaries to a list
  68. Iteritems () function: same as the items function
  69. The popitem() function removes elements from the dictionary
  70. The update() function: updates one dictionary entry with another
  71. Pass: Do nothing
  72. Exec: Executes a piece of code
  73. Eval: Evaluates Python expressions
  74. Ord () function: returns the int value of a single-character string
  75. The zip(sep1, sep2) function: creates a new sequence of parallel iterations in English
  76. Def hello() : custom function
  77. The import() function loads the extension library

Several common built-in functions used in Python

  1. Abs (x) is used to return the absolute value
  2. Divmod (x,y) returns a tuple (quotient, remainder) of the result of x/y.
  3. Pow (x,y) is used to find x to the y
  4. The all(iterable) function passes in an iterable object and returns True if all the numbers in the object have True bool values, or Flase otherwise
  5. The any(iterable) function passes in an iterable object that returns True if any of the numbers is True and Flase if all of the numbers are zero
  6. The CHR (x) function passes in an ASCII code and converts ASCII to the corresponding character
  7. The ord(x) function passes in a character that is converted to the corresponding ASCII code
  8. Hex () hexadecimal
  9. Oct (8) into the system
  10. Bin (2) into the system
  11. The x passed in enumerate(x,y) is a list, and y is the initial value for iteration
  12. The reduce() function is also a higher-order function built into Python. Reduce () takes arguments similar to Map (), a function F and a list, but behaves differently from Map (). Reduce () passes in f and must take two arguments. Reduce () calls f repeatedly for each element of list and returns the final result.
  13. Customizable sorted functions. Python’s built-in sorted() function sorts lists

Click 🎁🎁 to pick up dry goods full