Question: Write a recursive Python function called pattern that, when called with integer argument x will print that value x times, and then print the value
Write a recursive Python function called pattern that, when called with integer argument x will print that value x times, and then print the value of x-1, x-1 times, etc. until 1 is reached. For example, pattern(8) would print the following pattern: 8 7 Hint: Remember that str(5)*5 will create the string "55555
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
