the way to directly enter and execute python code at the prompt of the python console is called ______.
the options that belong to the high-level programming language include ______.
python is the ______ programming language.
the statements that don't report error include ______.
the prompt for the python console is >>>.
the statement in python ends with a semicolon.
the comments are to enhance the readability of the program, instead of actually running.
debugging is to solve syntax errors.
in the following options, ______ is not a constant.
when executing "print (0x20)", the output on the screen is ______.
python is a weakly typed language, and the type of the variable is determined by the type of its value.
1.25e3 is the scientific notation of the floating number 1250.0.
the subscript "[]" can not only access an element in the tuple, but also modify the element.
an empty collection can be created by "{}".
for a=15, after executing "a%=6", the value of a is ______.
the calculation result of 3 * 5 ** 2 is ______.
in the following options, the expressions that return true include ______.
in the following options, the expressions that the "*" is used as the repeat operator include ______.
when executing "print ('52 .50%%')", it will output 52.50%.
the result returned by the comparison operation or the logical operation must be a boolean value.
for the expression "x in y", the y must be an iterable object.
for the two assignment operators in the expression "a=b=1", it is calculated from right to left.
when drawing a flowchart, the condition judgment should be placed in ______.
when executing the following program, it will output ______. score = 80 if score<60: print('the score is %d'% score, end=', ') print('failed')
the pseudocode must meet the grammatical requirements of the python language.
when drawing a flowchart, the requirement must start from the "begin" and after any processing, it must reach the "end".
please write a program to implement the following functions: for the value x, if x is in the interval (1, 2] (i.e. x is larger than 1, and less than or equal to 2), then output the value of x 2.5; if x is in the interval [-1,1] (i.e. x is larger than or equal to -1, and less than or equal to 1), then output the value of 4.35*x; if x is in the interval [-2, -1) (i.e. x is larger than or equal to -1, and less than -1), the value of x is output; otherwise, "invalid" is output.
for the code "for x in y:", the y must be the ______.
to jump out of a loop, we should use ______.
when executing the following program, it will output ______. m = 5 while m==0: m-=1 print(m)
when executing "print(list(range (5)))", it outputs [0, 1, 2, 3, 4].
for the function call "fun(*a)", the type of the a may be ______.
the function in python can be defined by the "define" keyword.
by using the ______ statement, we can use the identifiers defined in another module.
for the function fun with no parameters in the module m, the statement "from m import fun as f" is written in the script file n.py. to call the function fun defined in the module m, the correct code written in n.py is ______.
for the function call "a.b.c.d()" in the script file n.py, the package names include ______.
by using "import m1; m2; m3", it can import three modules m1, m2 and m3.
a module can be placed in any package or sub-package.
a variable defined in a function is the ______ variable.
the lambda function refers to ______.
in the following options, the correct descriptions include ______.
in the following options, the correct descriptions include ______.
the scope of a variable refers to where it can be used.
global variables defined in a script file can only be used in the script file.
the lambda function can be passed as an argument to the parameter of the high-order function.
there are three poles a, b and c, and n discs where each disc is heavier than the next disc. the lightest disc is numbered as 1, and the heaviest disc is numbered as n. in the initial conguration, the discs are stacked upon another on the pole a where the lighter disks are above the heavier discs. we want to move all the discs to the last pole c with the following conditions: 1. only one disc can be moved from one pole to another at a time. 2. the discs have to be stacked such that all the lighter discs are on top of the heavier ones. tips: it is convenient to solve the problem using the recursion. to move n discs from the first pole a to the last pole c, we need to move n-1 discs to the middle pole b, then move the nth disc to the last pole c, and then move all n-1 discs from the middle pole b back to the last pole c.
the basic view of object-oriented programming is that all systems are composed of ( ).
if the first parameter of a method in a class corresponds to the object of the class, the method is the ( ).
in the following options, the correct descriptions include ( ).
for a new attribute that is dynamically bound to an object, it can only be accessed through the object.
there is an attribute __id in the student class, and stu is an object of the student class. when using stu to access the __id attribute, the correct way is ( ).
the method name of the constructor is ( ).
the destructor may have no parameters.
the __str__ method may return an integer.
if a class c1 is created by inheriting the existing class c, then c1 is called ( ) in the inheritance.
to determine whether a class is a subclass of another class, we should use the built-in function ( ).
there is a method fa in class a, there is an attribute b in class b, and there are the method fc and the attribute c in class c. if a is the parent class of b and b is the parent class of c, then the members in class b include ( ).
please fill the statement in the blank ___(1)___ and ___(2)___ to make the program run normally.
after executing a=list((1,2)) list((2,3))the value of a is ( ).
to calculate the number of elements in the list ls, we should use ( ).
to add a new element at the end of the list, the methods that can be used include ( ).
given "t=(true)", t is a tuple.
for the update method of the set, the argument passed in must be ( ).
to calculate the intersection of two sets, we should use the ( ) method of the set.
after executing a=dict(x=1,y=2) b=a a['y']=10 print(b)the output is ( ).
through "d.keys()" we can get an object composed of all the keys in the dictionary d.
after executing d=dict(sno='1810100', name='li xiaoming', age=19) r=del d['age']the value of r is 19.
the generator solves the ( ) problem that may exist when using lists to store data.
the return result of the list generation expression is a list.
given that "str='python#c ##python'", the result returned by "str.find('python')" is ( ).
to remove the head space in the string, we can use the ( ) method of the string.
after executing str1='abcdefabc' str2=str1.replace('abc','cba',1)the string saved in str2 is 'cbadefabc'.
for the two statements in the if statement sequence, if there are 4 spaces before the first statement and 1 tab before the second statement, the ( ) exception will be raised at runtime.
regardless of whether an exception occurs when the try clause is executed, the clause that will be executed is ( ).
in the following options, the expression that returns true is ( ).
to end this cycle and start the next cycle, we should use the ( ) statement.
there is a function fun without parameters in the m module, and there is the statementfrom m import fun in the script file n.py. to call the fun function in the m module, we should write ( ) in n.py.
the scope of a local variable is ( ).
( ) corresponds to the data that can use to save in the object of a class.
in a class, if a method is automatically executed by the system under certain circumstances, the method is ( ).
in a class, the method name of the destructor is ( ).
given that stu1 and stu2 are two objects of the student class, when executing "stu1>stu2", the ( ) method of the student class will be automatically executed.
if a class c1 is created by inheriting the existing class c, then c1 is called ( ).
if c is defined with a and b as the parent classes, the correct way to write the first line of code when defining c is ( ).
after executing ls=[1,3,2,5] ls.sort() the value of ls is ( ).
after executing a=tuple('my') tuple('book') the value of a is ( ).
to insert multiple elements into a dictionary at one time, we should call the ( ) method.
after executing str='a\rb\r\nc\n' r=str.splitlines(true)the value of r is ( ).
to read all data by line from a file at one time, we should use the ( ) method of the file object.
when executing a=10*1/0it will raise the ( ) exception.
the clause, that will only be executed if no exception occurs in the try clause, is ( ).
given thatls=[12,1.5,'abcd'] in the following options, the statements that will not report errors during execution include ( ).
in the following options, the expressions that use as the concatenation operator include ( ).
there is a function fun without any parameters in the m module, and the fun function in the m module can be directly called by "fun()" in the script file n.py. the correct import methods include ( ).
b is the parent class of a, a is an object of class a, and b is an object of class b. among the following options, the options that return true include ( ).
when calling the update method of the set, the argument passed in may be ( ).
after executing print('d:\\python')the output is d:\python
an empty set can be created by set()
an empty dictionary can be created through{}
every statement in python will be executed and executed only once.
given that t=(5,10,15)the output oflist(range(len(t))) is [1, 2, 3]
there are two functions f1 and f2 in the m module. by writing from m import *in the script file n.py, it will definitely import f1 and f2 in the m module.
multiple objects can be created using one class, and each object can store different data.
if b is the parent class of a, a is an object of class a, and b is an object of class b, then the statement isinstance(a, type(b)) returns true.
ifls=[0,1,2,3,4,5,6,7,8,9] then after executingdel ls[7:9] orls[7:9]=[] the elements in the resulting ls are the same.
the value of the largest element in tuple t can be obtained by max(t)
given thats={1,20,25} a new element can be added to s through s.add({2,3})
given that s1 and s2 are two sets, after executings1.union(s2) the elements in s1 are the union of the elements in the original two sets of s1 and s2.
after executing str='abcdefabc' str.replace('abc','cba') the value of str is 'cbadefcba'
after executingstr='like' str.upper() the value of str is 'like'