From c2d4c884d6d72d80a779f8f1c354217dc1d64ee4 Mon Sep 17 00:00:00 2001 From: mansour134 Date: Thu, 19 Feb 2026 12:27:11 +0300 Subject: [PATCH] solutin + bonus --- integer_stairs.py | 10 ++++++++++ return_of_the_stairs.py | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 integer_stairs.py create mode 100644 return_of_the_stairs.py 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