Update Lesson 2 Task 3 to use proper variable names

This commit is contained in:
Stanislav Mykhailenko 2023-01-27 11:49:18 +02:00
parent 3825606a00
commit 7dca0a4db0
GPG key ID: 1E95E66A9C9D6A36

View file

@ -7,11 +7,10 @@ try:
if number < 1: if number < 1:
raise ValueError("A natural number is required.") raise ValueError("A natural number is required.")
for i in range(number, 0, -1): for biggestNumber in range(number, 0, -1):
currentNumber = i for currentNumber in range(biggestNumber, 0, -1):
for j in range(currentNumber, 0, -1): print(currentNumber, end='')
print(j, end='') if currentNumber > 1: print(' ', end='')
if j > 1: print(' ', end='')
print('') print('')
except ValueError: except ValueError: