Display numbers from a list using loop
Write a program to display only those numbers from a list that satisfy the following conditions
- The number must be divisible by five
- If the number is greater than 150, then skip it and move to the next number
- If the number is greater than 500, then stop the loop
Given:
Expected output:
75
150
145
Hint:
break
statement to break the loop if the current number is greater than 500continue
statement move to next number if the current number is greater than 150umber % 5 == 0
condition to check if number is divisible by 5Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer