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解释器(编译器?)的位置。

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

  • 相关阅读:
    uniapp请求拦截
    stellar视差插件
    fullpage全屏插件应用
    fullpage全屏插件简介
    WdatePicker日期插件
    Ueditor富文本编辑器
    layer弹出层
    验证码绘制
    Ajax跨域访问
    JQuery封装的ajax方法
  • 原文地址:https://www.cnblogs.com/wanghongze95/p/13842723.html
Copyright © 2011-2022 走看看