zoukankan      html  css  js  c++  java
  • 四、python用户交互程序

    一、注释

    1、单行,代码注释:#

     2、多行注释:三个引号(单引号、或双引号)

     3、三个单引号,赋予个变量,打印,又可用作:多行打印

     4、单行打印

    msg1 = '''sjijid = ddcd'''
    #单引号套双引号,双套单
    msg2 = "I'm lili"
    print(msg1,msg2)

     5、账号密码,输入框:

    一种:

    username = input("username:")
    password = input("password:")
    print(username,password)

     二种:

    name = input("name:")
    job = input("job:")

    info = '''
    ----- info of %s -------
    name:%s
    job:%s
    ''' % (name,name,job)
    print(info)

     #str转换成int
    age = int(input("age:"))

    #打印字符类型,把age转为字符串str(age)
    print(type(age),type(str(age)))

    
    
    #d:整数、f:小数
    age:%s
     
  • 相关阅读:
    通过梯度下降和logistic回归求w向量和b
    一个节点的神经网络的工作流程
    对神经网络大致框架的理解
    内置对象
    对象
    预解析
    作用域
    函数
    数组
    循环和代码规范
  • 原文地址:https://www.cnblogs.com/liu1-/p/12795495.html
Copyright © 2011-2022 走看看