Introduction:
In this Python code, we will be printing multiples of 10 within a specified range.
Code:
#Print multiples of 10 for numbers in a given range
for num in range(5):
if num > 0:
print(num * 10)
Logic:
We will use a for loop to iterate through the numbers in the given range.
Then, we will check if the number is greater than 0.
If it is, we will multiply it by 10 and print the result.
Output:
The code will print the multiples of 10 for all numbers in the given range that are greater than 0.
>>10
>>20
>>30
>>40