zoukankan      html  css  js  c++  java
  • 输入输出

    #_*_coding:utf-8_*_

    # 在Python3中
    '''
    input:用户输入任何值,都存成字符串类型
    '''
    #(了解) Python2中

    # input:用户输入什么类型,就存成什么类型
    # raw_input:等于python3的input

    '''
    name = input ("Please enter your name:")
    age = input ("Please enter your age:")

    print('My name is my age is ',nmae,age)
    # My name is my age is oOC 10

    print('My name is ',name,'my age is ',age)
    # My name is oOC my age is 10

    print('My name is %s my age is %s' %(name,age))
    # My name is oOC my age is 10

    print('My name is %s my age is %s' %([1,2,3],10)) #%s可以收任意类型的值
    # My name is [1,2,3] my age is 10

    print('My name is %s my age is %d' %('oOC',10))
    # My name is oOC my age is 10

    print('My name is %s my age is %d' %('oOC','10')) #%d只能接收整型
    #TypeError: %d format: a number is required, not str
    '''


  • 相关阅读:
    day74test
    day73
    drf节流
    drf面试题及总结
    day72test
    日常积累
    windows 内核下获取进程路径
    转:浅析C++中的this指针
    vc 获取窗口标题GetWindowText
    驱动自定义回调例程
  • 原文地址:https://www.cnblogs.com/OutOfControl/p/9641481.html
Copyright © 2011-2022 走看看