1, pow (x, 0.5) can be calculated square root of x, calculates the square root of a negative number will
produce:
A, ValueError errors
B, no output
C, program crashes
D, plural
Analytical: >>> POW (-1, 0.5 ) ( 6.123233995736766e-+ 1J. 17)
2, on the following string .strip () function described method is
correct:
A, a particular character string replacement
B, is divided in accordance with the specified character string as an array
C, strings connecting the two sequences
D, both the specified character string is removed
Analysis: "remove both the specified character string" corresponding function is .strip () "is divided in accordance with the specified character string as an array" corresponding function is .split () "replace specific character string" a corresponding function is .replace () "connecting two character sequence" is a corresponding function operator +
3, the string is a continuous sequence of characters, which option can achieve print newline character information?
A, with spaces
B, using the "\ wrap"
C, with a \\ escape
D, use \ n
Analysis:
newline \ n, consistent with the C language.
Length value 4, val = pow (2,1000) , return to the line of code val result.
A, only (val)
B, len (pow (2.1000))
C, after not correct
D, only the (p (eq))
Analytical:
len (STR (val)) by first STR (val) val into digital type string, the string length and then obtained by len (), i.e., the number of digits val.
5, following on time library reference is not correct?
A、import time
B、from * import time
C、from time import *
D、from time import strftime
Parsing: from * Import Time should be: from Time Import *
6. Which option is not integer type in Python?
A、88
B、0E99
C、0B1010
D、0x9a
Analysis:
Decimal: generally expressed
in binary: 0B or beginning 0B
0o or beginning 0O: octal,
hexadecimal: 0x or 0X beginning
no beginning 0E
7, about four kinds of binary integer representation of a type described which option is correct?
A, binary, quaternary, octal, hexadecimal
B, binary, quaternary, decimal, hexadecimal
C, binary, octal, decimal, hexadecimal
D, binary, quaternary, octal, decimal
Parsing:
Python does not support quaternary integer
8. Which option is the meaning of the language Python% operator?
Remainder Quotient of A, x and y of
B, x power of y
Integer quotient C, x and y
D, x and y quotient
Analysis:
% is take the remainder, the same as the C language.
9. Which of the following is the result of the implementation of the code?
name = "Python programming language module" Print (name [0], name [2: -2], name [-1])
A, P thon Language Programming Division,
B, P thon language programming process
C, P thon language program design course
D, P thon language programming classes
Analytical:
s [N: M] represents the operation of the slice string s, from N to M, but does not include M
10. Which of the following is the result of the implementation of the code?
s='PYTHON' print("{0:3}".format(s))
The Python
B、 PYTHON
C, never mind
D、PYTHON
Analysis:
{ 0: 3} denotes the width of the output is 3, but if the string length exceeds 3, the string length of the display places.