jython学习笔记2
1.%是求余,//是整除的商,**是乘方
| abs(var) | Absolute value |
| pow(x, y) | Can be used in place of ** operator |
| pow(x,y,modulo) | Ternary power-modulo (x **y) % modulo |
| round(var[, n]) | Returns a value rounded to the nearest 10-n or (10**-n), where n defaults to 0) |
| divmod(x, y) | Returns a tuple of the quotient and the remainder of division |
| Operator Precedence from Highest to Lowest | Name |
| +var, -var, ~var | Unary Operations |
| ** | Power Operations |
| *, /, //, % | Multiplication, Division, Floor Division, Modulo |
| +, - | Addition, Subtraction |
| <<, >> | Left and Right Shift |
| & | Bitwise And |
| ^ | Bitwise Exclusive Or |
| || | Bitwise Or |
| <, >, <=. >= , <> | Comparison Operators |
| ==, != , is, is not, in, not in | Equality and Membership |
| and, or, not | Boolean Conditionals |
| Function | Description | |
| chr(value) | Converts integer to a character | |
| complex(real [,imag]) | Produces a complex number | |
| dict(sequence) | Produces a dictionary from a given sequence of (key, value) tuples | |
| eval(string) | Evaluates a string to return an object…useful for mathematical computations. Note: This function should be used with extreme caution as it can pose a security hazard if not used properly. | |
| float(value) | Converts number to float | |
| frozenset(set) |Converts a set into a frozen set | ||
| hex(value) | Converts an integer into a string representing that number in hex | |
| int(value [, base]) | Converts to an integer using a base if a string is given | |
| list(sequence) | Converts a given sequence into a list | |
| long(value [, base]) | Converts to a long using a base if a string is given | |
| oct(value) | Converts an integer to a string representing that number as an octal | |
| ord(value) | Converts a character into its integer value | |
| repr(value) | Converts object into an expression string. Same as enclosing expression in reverse quotes ( x + y). Returns a string containing a printable and evaluable representation of the object | |
| set(sequence) | Converts a sequence into a set | |
| str(value) | Converts an object into a string Returns a string containing a printable representation of the value, but not an evaluable string | |
| tuple(sequence) | Converts a given sequence to a tuple | |
| unichr(value) | Converts integer to a Unicode character | |
2. 对于可以修改的变量的缺省值,例如List, 在初始化的时候是不确定的,你希望它能够初始化成一个空的列表,但其实不是这样的。这点要注意
3.后进先出的栈。任何的Python方法都有返回值。
4.不知道如何在控制台接收键盘输入

浙公网安备 33010602011771号