• Python-for


    一、简单图形打印

    '''

    打印一下图形在输入上面

    * * * * *

    * * * * *

    * * * * *

    '''

    print("hello world")

    二、

    """
    打印一下图形在输入上面
    * * * * *
    * * * * *
    * * * * *
    """
    """
    print("* * * * *")
    print("* * * * *")
    print("* * * * *")
    print("* * * * *")
    """
    """
    # 更改上面代码
    print("* " * 5)
    print("* " * 5)
    print("* " * 5)
    print("* " * 5)
    """
    '''
    for i in range(0, 4):
    print("* " * 5)
    '''
    '''
    for i in range(0, 4):
    for j in range(5):
    print("* ", end= "")
    print()
    '''
    '''for i in range(0, 4):
    print("* " * 5)
    ----------------------------------
    '''
    # 简单图形打印
    """
    打印一下图形在输出上面
    * * * * *
    * *
    * *
    * *
    * * * * *
    """
    '''
    for i in range(4):
    if i == 0 or i == 3:
    print("* " * 5)

    if i == 1 or i == 2:
    print("* *")
    ------------------------------
    '''
    # 更改上面写法
    # 外层循环控制行
    for i in range(4):
    if i == 0 or i == 3:
    print("* " * 5)

    if i == 1 or i == 2:
    for j in range(5):
    if j == 0 or j == 4:
    print("* ", end="")
    else:
    print(" ", end="")
    print()
  • 相关阅读:
    eclipse debug小技巧
    session.flush加锁测试.
    mac os x升级MOUNTAIN LION后svn command not found的解决
    Linux下vi命令大全(转)
    Java 集合框架
    java 实用类
    Java 输入/输出 反射
    Java 注解
    多线程(重点)
    多线程
  • 原文地址:https://www.cnblogs.com/niaocaizhou/p/10881692.html
Copyright © 2020-2023  润新知