zoukankan      html  css  js  c++  java
  • python基础

    Python 在sublime 中注释方法

    程序中记录备注提示代码所完成的事情  增强程序的可读性

    #开头  单行注释

    ‘’‘ 三个单引号为多行注释 ’‘’

     

    Python程序中是默认不支持中文  程序开头加#encoding=utf-8

     

    存储数据的容器叫变量

    常量 变量 标识符 变量名区分大小写

    变量命名 驼峰命名法  userName/userNameAre小驼峰    UserName大驼峰

     

    Type(b)查看b的变量类型

    格式化输出

            Score=100

            Prit(“my English score is %d”%Score)

                  machScore=120

           print(“my English score is %d,,,,,my mach score is %d”%(Score,machScore))

    print(“11111111111 77777777777”)

    输出11111111111

           77777777777

    Python3中的input和python2中的raw_input用法一样

    time.sleep(秒)延时设置

     

    例:

    #python’自动不识别汉字 引用包

    #encoding=UTF-8 ()

    #延时命令引用

    import time

     

    #设置输入并保存变量值

    name=input("what's your name:")

    phoneNumber=input("what's your number:")

    adress=input("where:")

    QQ=input("QQ:")

     

    #打印等待

    print("xitongdayinzhong:3...")

    time.sleep(1)

    print("xitongdayinzhong:2...")

    time.sleep(1)

    print("xitongdayinzhong:1...")

    time.sleep(1)

     

    #打印结果

    print("=============================")

    print("name:%s number:%s adress:%s QQ%s"%(name,phoneNumber,adress,QQ))

    print("=============================")

  • 相关阅读:
    PouchContainer Goroutine Leak 检测实践
    CDN全站加速助力企业云上升级
    互联网架构如何促进数字化营销
    设计模式之模板方法
    设计模式之外观模式
    设计模式之适配器模式
    分布式理论(一)CAP 理论
    边缘计算基本概念
    MQTT实战之MQTT入门
    高性能NIO通信框架之Netty架构总结(1)
  • 原文地址:https://www.cnblogs.com/bianjing/p/8253425.html
Copyright © 2011-2022 走看看