TOCPython Draft for Information Only
ContentPython Language
Python LanguagePython language is similar to visual basic. Python script is also interpretered by an interpreter line by line, but there are many differences between the languages.Python Rule NotationThe rule notation used in Python:
Examplename::=lc_letter (lc_letter | "_")
lc_letter::="a"..."z"
Python Language GrammarThe typical elements of Python Language of version 3.8.x.IdentifiersIdentifiers or names are the name of a Python thing. Identifiers are unlimited in length but case is significant. The valid characters within the ASCII rangeidentifier::=xid_start xid_continue* id_start::=<all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property> id_continue::=<all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property> xid_start::=<all characters in id_start whose NFKC normalization is in "id_start xid_continue*"> xid_continue::=<all characters in id_continue whose NFKC normalization is in "id_continue*">The Unicode category codes mentioned above stand for:
KeywordsSome words are used as reserved words or keywords of the Python language that have special meaning and cannot be used as ordinary identifiers.Reserved Keywordskeyword::="and" | "as" | "assert" | "async" | "await" | "break" | "class" | "continue" | "def" | "del" | "elif" | "else" | "except" | "False" | "finally" | "for" | "from" | "global" | "if" | "import" | "in" | "is" | "lambda" | "None" | "nonlocal" | "not" | "or" | "pass" | "raise" | "return" | "True" | "try" | "while" | "with" | "yield" | "print" | "exec" Reserved Classed of IdentifiersSome classes of identifiers with the patterns of leading and trailing underscore characters having special meanings are also reserved. _*Not import byLiteralsLiterals are notations for constant values of some built-in types. Some typical literals are string literalsCharacter string bytes literalsImmutable sequence of single byte bytearray literalsMutable sequence of bytes numeric literalsNumeric Value integer literalsInteger Value floating point literalsFloating point number imaginary literalsImaginary boolean literalsBoolean value list literalsMutable sequence of objects tuple literalsImmutable sequence of objects dictionary literalsMutable associative mapping (aka dictionary) set literalsMutable unordered set of distinct objects frozenset literalsImmutable form of set classOperatorsAn operator is a symbol that performs an operation on one or more operands.Operators::="+" | "-" | "*" | "**" | "/" | "//" | "%" | "@" | "<<" | ">>" | "&" | "|" | "^" | "~" | ":=" | "<" | ">" | "<=" | ">=" | "==" | "!=" DelimitersA delimiter is a sequence of one or more characters used to specify the boundary between independent regions or elements.Operators::="(" | ")" | "[" | "]" | "{" | "}" | "," | ":" | "." | ";" | "@" | "=" | "->" | "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "@=" | "&=" | "|=" | "^=" | "<<=" | ">>=" | "**="The period can also occur in floating-point and imaginary literals. A sequence of three periods has a special meaning as an ellipsis literal. The second half of the list, the augmented assignment operators, serve lexically as delimiters, but also perform an operation. The printing ASCII characters, Source and Reference©sideway ID: 200501002 Last Updated: 5/10/2020 Revision: 0 Latest Updated Links
|
Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Reference 79 Computer Hardware 249 Software Application 213 Digitization 32 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 429 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019