美文网首页
Your First Python Program

Your First Python Program

作者: 游文影月志 | 来源:发表于2020-07-20 00:25 被阅读0次

    Every Python function returns a value, if the function ever executes a return statement, it will return that value, otherwise it will return None.

    Everything in Python is an object. Strings are objects. Lists are objects. Functions are objects. Classes are objects. Class instances are objects. Even modules are objects.

    Python uses carriage returns to separate statements and a colon and indentation to separate code blocks. c++ and Java use semicolons to separate statements and curly braces to separate code blocks.

    Python uses try...except blocks to handle exceptions, and the raise statement to generate them. Java and c++ use try...catch blocks to handle exceptions, and the throw statement to generate them.

    All names in Python are case-sensitive: variable names, function names, class names, module names, exception names. If you can get it, set it, call it, construct it, import it, or raise it, it's case-sensitive.

    相关文章

      网友评论

          本文标题:Your First Python Program

          本文链接:https://www.haomeiwen.com/subject/xfbdkktx.html