diff --git a/bouns.py b/bouns.py new file mode 100644 index 0000000..3aad26e --- /dev/null +++ b/bouns.py @@ -0,0 +1,16 @@ +def functions(a: int): + '''Returns a descending number pattern from the given integer down to 1 as a string''' + + result = "" + + for i in range(a, 0, -1): + for j in range(i, 0, -1): + result += str(j) + " " + result += "\n" + + return result + +pattern = functions(8) +print(pattern) + +print(functions.__doc__) diff --git a/function.py b/function.py new file mode 100644 index 0000000..38ff1a8 --- /dev/null +++ b/function.py @@ -0,0 +1,10 @@ +def functions(a: int): + ''' Prints a descending number pattern from the given integer to 1.''' + + for i in range(a, 0, -1): + for j in range(i, 0, -1): + print(j, end=" ") + print() +functions(8) + +print(functions.__doc__) \ No newline at end of file