diff --git a/integer_stairs.py b/integer_stairs.py new file mode 100644 index 0000000..39382e4 --- /dev/null +++ b/integer_stairs.py @@ -0,0 +1,10 @@ +def int_number(x:int): + ''' this function takes an integer and draw stairs shape with it numbers ''' + while x != 0: + for i in range(x,0,-1): + print(i, end=" ") + print("") + x -= 1 + +int_number(5) +print(int_number.__doc__) \ No newline at end of file diff --git a/return_of_the_stairs.py b/return_of_the_stairs.py new file mode 100644 index 0000000..afbe013 --- /dev/null +++ b/return_of_the_stairs.py @@ -0,0 +1,13 @@ +def int_number(x:int): + ''' this function takes an integer and draw stairs shape with it numbers ''' + string:str = "" + while x != 0: + for i in range(x,0,-1): + string += str(i) + " " + string += "\n" + x -= 1 + return string + +variable = int_number(5) +print(variable) +print(int_number.__doc__) \ No newline at end of file