zoukankan      html  css  js  c++  java
  • python3基础1

    function:python基础语法练习
    """
    
    #import this
    
    name = "tom"
    age = 29
    
    str1 = "hello, " + name + "; age," + str(age)
    str2 = "hello, %s ; age, %d " %(name, age)
    str3 = "hello, {n} ; age, {a}".format(n=name, a=age)
    print(str3)
    
    
    # n = input("input you name:")
    # print("hello-->", name)
    
    # 引号的使用
    print("他说:'你好'! ")
    print('他说:"你好"! ')
    
    '''
    '''
    # 顺序、分支、循环
    
    """
    a == b 相等
    a >= b 大于等于
    a <= b 小于等于
    a != b 不等于
    a is b 是
    a is not b 不是
    """
    a = 4
    b = 5
    if a > b:
    print("a big")
    else:
    print("b big")
    
    if True:
    print("run this info")
    
    c = True
    if c is True:
    print("run this info")
    
    if c is not False:
    print("run this info")
    
    d = None
    if d is None:
    print("d is None")
    
    number = 77
    if number > 90:
    print("优秀")
    elif number > 70:
    print("良好")
    elif number > 60:
    print("及格") 
    else:
    print("不及格")
    
    
    hello = "hello"
    for i in hello:
    print(i)
  • 相关阅读:
    可持续化线段树(主席树)
    2016-06-19 NOIP模拟赛
    0618图的整理
    1536 海战
    1005 生日礼物
    3280 easyfinding
    2594 解药还是毒药
    2919 选择题
    1845 二叉查找树
    1174 靶形数独
  • 原文地址:https://www.cnblogs.com/huny/p/12041857.html
Copyright © 2011-2022 走看看