Write a program with for loop: Output the mumbers betveen 100 and300 that are no divisibleby 3.
时间: 2024-02-17 10:00:59 浏览: 21
Sure, here's a Python program that uses a for loop to output the numbers between 100 and 300 that are not divisible by 3:
```python
for num in range(100, 301):
if num % 3 != 0:
print(num)
```
In this program, we use a for loop with the `range()` function to loop through all the numbers between 100 and 300. For each number, we check if it is not divisible by 3 using the modulo operator `%`. If the remainder of the division is not 0 (i.e., the number is not divisible by 3), we print the number to the console.
This program will output all the numbers between 100 and 300 that are not divisible by 3.