>>>defparrot(voltage,state="a stiff") : ... print("--this is voltage :" , voltage)... print("--this is state :", state)... >>>parrot(voltage =1, "stiff") File "<stdin>", line 1SyntaxError: positional argument follows keyword argument >>>parrot(voltage =1, state ="stiff")--this is voltage :1--this is state : stiff
读取空行之后缩进格数作为标准的理由是:
(We can’t use the first line since it is generally adjacent to the string’s opening quotes so its indentation is not apparent in the string literal.
不太懂。从编码上看很明确吧?
In text files (those opened without a b in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with seek(0, 2)) and the only valid offset values are those returned from the f.tell(), or zero. Any other offset value produces undefined behaviour.