Programs · Program 6-9
Q.Program 6-9: Program to print the multiples of 10 for numbers in a given range.
Tripura TbseTextbookSubjective· 3mImportance★★★★★est
33% · 13/39 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Iterate over the whole range with for num in range(10, 51): and use the modulus test num % 10 == 0 to print only the multiples of 10 — giving 10, 20, 30, 40, 50.
The idea. "Multiples of 10 in a range" is again the loop + condition pattern: generate every candidate number in the range with range(), and let an if with the modulus operator pick out those exactly divisible by 10.
# Program 6-9: print the multiples of 10 for numbers in a given range
for num in range(10, 51):
if num % 10 == 0:
print(num)
Expected output
10
20
30
40
50
How it works
range(10, 51)supplies every integer from 10 to 50 (51 is excluded, so 50 is the last candidate — remember the +1 on the stop value).num % 10is the remainder after dividing by 10; it is0only for 10, 20, 30, 40, 50, so only those five values reachprint(num).- All other numbers in the range fail the test and are skipped silently. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.