编程语言
首页 > 编程语言> > python输出三角形

python输出三角形

作者:互联网

# -*- coding: utf-8 -*-
# @Time : 2022/2/22 16:18
# @Author : Relieved


"""
line : 行数
Difference :差值
multiple : 倍率

"""


class OutStart:

    @staticmethod
    def RunAll(line=1, Difference=1, multiple=1):
        i = 1
        while i < line:
            j = 0
            while j < i:
                print("*", end="")
                j += 1
            print("")
            i = (i + Difference) * multiple


if __name__ == '__main__':
    try:
        vLine = int(input("vLine : 1 - 99"))
        vDifference = int(input("vDifference : 1 - 9"))
        vMultiple = int(input("vMultiple : 1 - 9"))
        if (1 <= vLine <= 99) or (1 <= vDifference <= 9) or (1 <= vMultiple <= 9):
            OutStart.RunAll(line=vLine, Difference=vDifference, multiple=vMultiple)
        else:
            print("Error : > Incorrect input <")
    except Exception as e:
        print(">>> ", e)

标签:__,输出,multiple,python,int,input,三角形,Difference,line
来源: https://blog.csdn.net/m0_53614338/article/details/123103808