I am having the same issue with this LAB: Number pattern Here is my code: def print_num_pattern(num1,num2):
Fantastic news! We've Found the answer you've been seeking!
Question:
I am having the same issue with this LAB: Number pattern
Here is my code:
def print_num_pattern(num1,num2):
if (num1 == 0 or num1 < 0): print(num1, end = ' ') return
print(num1, end = ' ') print_num_pattern(num1 - num2, num2)
print(num1, end = ' ')
if __name__ == "__main__": num1 = int(input()) num2 = int(input()) print_num_pattern(num1, num2)
My output is:
12 9 6 3 0 3 6 9 12
The Expected output:
12 9 6 3 0 -3 0 3 6 9 12
Please Help me.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: