Python computer second-level related concepts

1. Python's most common combined data types include collection types, sequence types, and mapping types. The sequence types include string type, list type, and tuple type.

2. Python is a script parsing language. There is no such thing as a main function. The entire python program is executed from top to bottom.

3. High-level languages ​​are divided into two categories according to computer execution mechanisms: static languages ​​and dynamic languages. The static language is run in a compiled mode, and the script language is executed in an interpreted mode. C language is a static language, and python is a script language. The compilation process is the process of converting the source code into the target code, and the interpretation is the process of converting the source code into the target code one by one while running the target code one by one.

4. The output result of the following code is: (D)

A ["A", "B", "C"]   B  ["A", "B", "C", "D", "D"]     C ["A", "B", "C", "D", "D", "D"]   D  ["A", "B", "C", "D"]

if __name__ == '__main__':
    # 使用debug进行调试会好理解一点
    letter = ["A", "B", "C", "D", "D", "D"]
    for i in letter:
        if i == "D":
            letter.remove(i)
    print(letter)

This question is actually very easy to be wrong. I used the debug mode of pycharm to debug and found that after removing the current element, the extracted element still corresponds to the element of the list of currently removed elements according to the original index. For example, at the beginning, it loops to the first "D", and it is found that the condition is met, then after the remove function is executed, it will get ["A", "B", "C", "D", "D"], and the next traverse corresponds If the index is 4, then the judgment found that the condition is also met, and the last "D" is deleted. At this time, the end of the list is reached. At this time, the loop is over, so at the end only ["A", "B", "C","D"]

5. Polygon internal angle and formula: (n-2) * 180, where n is the number of sides of the polygon, you can use python to draw a set of graphics, such as square, rhombus, and regular n-sided drawing, calculate the internal angle and divide by the side The number is the degree of each angle of the polygon, and the angle of each rotation can be determined according to the degree of each internal angle

6. The output result of the following code is: print(0.1 + 0.2 == 0.3) The output result is False, which is different from the python we usually understand. It involves the storage of floating-point numbers in python, please refer to the blog

7. In any tree, the number of leaf nodes is n0 = 1 + n2 + 2n3 + ... (n-1)nn. The relationship between node degree 0 and degree 2 in any binary tree is : N0 = n2 + 1

8. Design method of structured program: adopt the design method of top-down, gradual refinement, modular design, and structured coding

9. The closeness of the association between two or more modules is called: coupling degree

10. In the software development process, the main documents produced in the requirements analysis stage are: software requirements specifications

11. Which of the following descriptions is correct (A)
A. The linear linked list is the chain storage structure of the linear list
B. Stacks and queues are non-linear structures
. C. The doubly linked list is a non-linear structure
D. A binary tree with only the root node is a linear structure

According to the complexity of the context between the data elements in the data structure, the data structure is generally divided into two types: linear structure and non-linear structure. If a non-empty data structure satisfies the following two conditions: ①There is and only one root node; ②Each node has at most one antecedent and at most one subsequent item. The data structure is called a linear structure, also known as a linear table. So linear lists, stacks and queues, and linear linked lists are all linear structures, while binary trees are non-linear structures.

12. The relationship between the two entity sets of "commodity" and "customer" is generally: many-to-many

In this question, a customer can purchase multiple products, and the same product can be purchased by multiple customers, so there is a many-to-many relationship between products and customers.

13. The relationship between database, database system and database management system: database system includes database and database management system, DBS includes DB and DBMS

14. The graphics used to represent entities in the ER diagram are: (B)

A triangle B rectangle C rhombus D ellipse

The ellipse represents the attribute, and the diamond represents the connection between entities

15. The following is not a keyword of the python language ()

A return    B function    C def     D define

16. The following options can not change the drawing direction of the turtle is (B)

A turtle.seth()    B turtle.fd()    C turtle.circle()   D turtle.right()

The circle(r) function draws a circle with a radius of r. If r is positive, the center of the drawn circle is on the left side of the forward direction, and if it is negative, the center of the drawn circle is on the right side of the forward direction.

17. The ascii code of a space is decimal 32, which is less than the ascii value of lowercase and uppercase letters

18. Regarding the description of the function, what is wrong is (B):

A Reduce programming complexity B Improve code running speed C Reuse code D Improve code readability

19. In the random library, if the same seed is set, the random number generated every time the random function is called is the same

import random
random.seed(0)
for i in range(10):
    print(random.randint(1, 10), end=" ")
print("^" * 30)
random.seed(0)
for i in range(10):
    print(random.randint(1, 10), end=" ")

20. The following third-party libraries belonging to python text processing are (B):

A mayavi    B pdfminer    C TVTK   D pygame

The mayavi library is a three-dimensional visualization library for processing scientific computing. The pdfminer library can extract information from PDF documents. Unlike other PDF-related tools, it focuses on acquiring and analyzing text data. TVTK is also a three-dimensional visualization library for scientific computing. pygame is a set of modules used to develop game software

21. random.uniform(a, b): used to generate random decimals between [a, b]

22. The following third-party libraries belonging to the direction of python web development are (D)

A cocos2d    B Panda3d   C Pygame   D Django 

cocos2d is an open source framework based on the MIT protocol for building games, applications and other graphical interface interactive applications. Django is an open source model-view-controller (MVC) style web application framework driven by the python programming language

23. Among the  following options, the correct description of the identity of the floating point number 0.0 and the integer 0 is (C)
A They use the same computer instruction processing method
B They have the same data type
C They have the same value
D They use the same Hardware execution unit

Not sure if the answer is C The answer on the Internet is C

24. Tensorflow is Google's second-generation machine learning system framework. SnowNLP is a library written in python that can easily process Chinese text content. It was written inspired by TextBlob, because most of the current natural language processing libraries Basically all for English, so I wrote a class library that is convenient to handle Chinese, and unlike TextBlob, NLTK is not used here

25. The output of the following program is ()

a = 4.2e-1

b = 1.3e2

print(a + b)

The output result is: 130.42

26. The output of the following program is ()

t, g, y = 'It\'s', chr(64), "you"
s = t + g + y
print(s)

The output result is: It's@you

27. System software includes operating system, compiler, assembler, network software, database management system

28. The document to determine whether the software project is developed is (D)

A Requirements analysis specification B Software development report C Test report D Feasibility report

29. Can not return the list type is (C)

A range() B s.split() C dict.items() D s.lcut() dict.items() returns an internal data type dict_items in python

30. The execution result of the following statement is (D)

with open("A.txt", "w+") as fo:

       fo.write("hello")

       print(fo.read())

A A read and write exception occurred. B The function to read the file did not read the string from the file. C Write a "hello" string to the file a.txt, and a "hello" string displayed on the screen. D Write to the file "a. A string of "hello" in "txt"

When print(fo.read()) is outputting, the file indicator is already at the end, so there is no output on the screen

31. The function of the following pip tool not belonging to python is (A)

A Package the python source code B Install third-party python libraries C Uninstall the installed third-party libraries D Perform basic maintenance of the third-party libraries

32. Python is not a machine language, python language is a widely used high-level general-purpose scripting programming language

33. The following description does not belong to the characteristics of the database system is (C)

A Data sharing B Data integrity C High data redundancy D High data independence

34. In the three-level model of the database, there are multiple external models, and there is only one conceptual model and internal model

35. The language that supports security definition and inspection in the database system is (A)

A Data control language B Data definition language C Data manipulation language D None of the above

Data definition language: responsible for data schema definition and data physical access construction. Data manipulation language: Responsible for adding, deleting, modifying and checking data

36. A software process is a set of related resources and activities that transform inputs into outputs

37. The output result of the following code is (A)

A No output B Python C pytho D PythonCRE

for c in "Python NCRE":
        if c == "N":
            break
            print(c)

At the beginning, I misread it and chose C by mistake. In fact, when traversing to N, it breaks at this time, and there is no output.

38. Regarding the function definition, the following form is wrong (D)

A deffoo(a, b)     B deffoo(a, b = 10)   C deffoo(a, *b)    D deffoo(*a, b)

If a function needs to receive actual parameters in multiple forms, the positional parameter will usually be placed at the top of the definition, then the default parameter, followed by a variable-length parameter with an asterisk, and finally a variable-length parameter with two asterisks. Variable length parameter

39. Expression 3 + 5% 6 * 2 // 8 = (4) 5% 6 * 2 // 8 = 5 * 2 // 8 = 1

40. The objects defined by the data dictionary are included in (A)

A Data flow diagram (DFD diagram) B Program flow chart C Software structure diagram D Block diagram

41. The result obtained during the conceptual design stage of the database is (A)

A ER model B Data dictionary C Relational model D Physical model

42. Test case design technology based on the logical structure of the program belongs to (D)

A. Gray box testing B. Data testing C. Black box testing D. White box testing

43. In the following sorting method, every time the exchange of elements will produce a new reverse order is (C)

A Bubble sort B Simple selection sort C Quick sort D Simple insertion sort

Bubble sort only exchanges adjacent elements, but not every move creates a new reverse order. The element movement of simple insertion sort does not produce a new reverse order. Quicksort will generate a new reverse order every time the exchange moves, because when there will be no new reverse order, the current round of comparison ends.

44. The output result of the following code is (0j)

x = 4 + 3d

y = -4 - 3j

print(x + y)

Guess you like

Origin blog.csdn.net/qq_39445165/article/details/114979029