Knowledge content:
1.Python basic concepts and basic syntax
2. Python basic data types
3. python module related
4. Python function related
5. Python object-oriented related
6. python file processing related
1. Basic concepts and basic syntax of python
1. What kind of language is python, what are its advantages and disadvantages, and what are its application areas?
3. What is the function of variables in python and how should they be named reasonably?
42. Explain the and-or syntax
of python 4. How does python manage memory?
34. What are the variable scopes in python? How to check scope?
61. What is the function of the pass statement in Python?
35. What is the nature of variables in python? What is the essence of def?
23. Briefly describe the loop and branch statements in python
24. Briefly describe the writing format of ternary operations and application scenarios
52. Is there a tool that can help find python bugs and perform static code analysis?
20. What is the difference between / and // in python3, and what is the difference between * and **
Second, python basic data types
6.Which variable data types and which are immutable data types in the basic data types of python, what is the difference between the two
7. What are the two splicing methods of python strings?
8. How to split python strings?
9.How to remove some characters at the beginning or end of
python strings 10.What are the two methods of python string formatting?
11. How to add, delete, modify and search python lists?
57. How does python get the intersection and difference of two lists
58. How to iterate a sequence in reverse order? how do I iterate over a sequence in reverse order
59. Python interview question: Please write a piece of Python code to delete duplicate elements in a list
12. What is the difference between
a tuple and a list in python 13. What are the characteristics of a dictionary in python
14 .How to add, delete, modify, and check dictionaries in
python 15. What are the characteristics of python collections
62. How to generate mutable collections and immutable collections?
16. What are the two major functions of python collections?
43. How does Python perform type conversion?
44. How to realize the conversion of tuple and list in Python?
45. Please write a piece of Python code to delete duplicate elements in a list
46. How to copy an object in Python?
47. How to use Python to query and replace a text string?
17. What can the slice action object be in python and how to do it?
98. How to realize the conversion of tuple and list in Python?
19. What is a list comprehension, please give an example
Three, python module related
99. How to use Python to send mail?
25. How to import modules in python?
26. There are two directories a and b under the atm directory, 1.py under a and 2.py under b, how to import 2.py from 1.py?
Please write a universal code to solve this problem
48. What is the difference between search() and match() in Python?
74. How to alias a module
75. Briefly describe re.findall()
76. How to get command line parameters in python
77. Briefly describe serialization and deserialization
78. Briefly describe the json module and pickle module
79. Briefly describe the shelve module
80 What is the role of the .shuutil module?
81. Briefly describe the configparser module and the logging module
49. When using Python to match HTML tags, what is the difference between <.*> and <.*?>?
50. How to generate random numbers in Python?
Four, python function related
2. Briefly describe the difference between the input and output functions in python2 and python3
21. Briefly describe the role of built-in functions globals() and locals()
27. Briefly describe the function of functions
36. Briefly describe nested functions in python
51. How does Python define a function?
63. Briefly describe enumerate, zip
64. Briefly describe iter
65. Which of the built-in functions in python are for sequence operation?
66. What is the difference between sorted() and sort()? 67. What is the difference between
type() and isinstance()? 68. Briefly describe the
hash function
69. Which objects can len() act on? And
what is the relationship between the two 83. What is the difference between
yield, return, and next
84. What is the difference between an iterable object and an iterator
85. How to judge an iterable object and an iterator
86. How to create a generator
87. How to traverse the generation 53. How to
set a global variable in a function?
54. There are two sequences a, b, both of size n, the value of the sequence elements is an arbitrary integer number, unordered;
requirements: By exchanging the elements in a, b, make [the sum of the elements of the sequence a] and [the elements of the sequence b] and ] the smallest difference.
37. Briefly describe the writing format of lambda expressions and application scenarios
38. What is a recursive function? What are the properties of recursive functions? What's the point of writing a recursive function?
39. Briefly describe functional programming and its advantages and disadvantages
40. Briefly describe higher-order functions and closures
41. How to output a Fibonacci sequence in Python?
28. What is the default return value of a function?
29. Does a function pass a reference or a copy value when passing parameters? Please prove your answer!
30. Briefly describe the characteristics and precautions of positional parameters, keyword parameters, default parameters, variable-length parameters of
functions 31. Briefly describe the difference between the range function in python3 and the range function in python2.7
32. Built-in function any What is the difference with all
22. Briefly describe the difference between break, continue, and return
18. What are the functions commonly used for sequence operations in python? Please list a few and explain what they do
92. Please briefly describe the decorator and the application scenarios of the decorator
Five, python object-oriented related
88. What is the open-closed principle
89. What is the difference between object-oriented and process-oriented
90. What are the three major characteristics of object-oriented 5. Is
python a complete object-oriented language and why?
91. What is the difference between static methods and class methods
in python object orientation 93. Briefly describe the attributes in python object orientation
94. What is the difference between new and old classes in python object orientation?
95. Briefly describe exception handling in
python 96. Briefly describe assertion and context management
in python 97. Briefly describe the self parameter in python
100. What is the difference between exception and error
60. Introduce the usage and function of except?
Six, python file processing related
70. How does python open a file, and how to read the file content after opening?
71.How to add content after the source file in python?
72. How to modify files in python?
73. Briefly describe the character encoding of python2 and python3
33. Briefly describe the difference between file open mode r and rb
55. How to delete a file with Python?
56. How does Python copy a file?