zoukankan      html  css  js  c++  java
  • 《笨办法学Python》 第2课手记

    《笨办法学Python》 第2课手记

    这节课的内容很简单,目的是要探求#号的作用,目前我们已知的内容是,作为注释的标识符。

    在Python中输入如下代码并运行。

    # A comment, this is so you can read your program later.
    # Anything after the # is ignored by python.
    
    print "I could have code like this." # and the comment after is ignored
    
    # You can also use a comment to "disable" or comment out a piece of code:
    #print "This won't run."
    
    print "This will run."

    结果:
    这里写图片描述

    只有中间两句话输出,因为其余部分在python都是注释,编译时都被忽略。

    本节涉及的内容:

    “#”在python中的作用:

    #!/usr/bin/python

    这段代码中#用来定义python解释器(编译器?)的位置。

    目前只在知乎找到这么一个除了注释之外的作用,稍后再补吧。

  • 相关阅读:
    CF 234 C Weather(粗暴方法)
    给工作赋予的新意义——Leo鉴书78
    获取集合的方法
    VS 统计代码行数
    , ,
    指针的删除动作
    C++ 名称空间
    boost::token_compress_on
    指针与引用
    容器的end()方法
  • 原文地址:https://www.cnblogs.com/wanghongze95/p/13842723.html
Copyright © 2011-2022 走看看