用Python代码写三个if和循环设计
时间: 2024-05-02 14:18:33 浏览: 121
if-else语句:
```
x = 5
if x > 10:
print("x is greater than 10")
else:
print("x is less than or equal to 10")
```
for循环:
```
fruits = ["apple", "banana", "orange"]
for fruit in fruits:
print(fruit)
```
while循环:
```
count = 0
while count < 5:
print("Count is", count)
count += 1
```
阅读全文