使用while 语句实现打印出1至10.count = 1while ( ) print (count) count = count + 1
A: count
B: True
C: count
D: count
A: count
B: True
C: count
D: count
举一反三
- 使用while 语句实现打印出1至10.count = 1while ( ) print (count) count = count + 1 if i>10 : break A: 1 : B: True : C: True D: 0
- count = 0 while count < 5: print (count, " 小于 5") count = count + 1 else: print (count, " 大于或等于 5")
- 下列程序的运行结果是( )。 count = 0 while count < 5: print(count, " is less than 5") count = count + 1 else: print(count, " is not less than 5")
- 使用for 语句把 Python 字符串的每个字母依次打印出来,下面哪个选项实现了() A: count=1 for letter in Python: print(“Python的第"+str(count)+"个字母是”+letter) count=count+1 B: count=1 for letter "Python”: print(“Python的第"+str(count)+"个字母是”+letter) count=count+1 C: count=1 for letter in "Python": print(“Python的第"+str(count)+"个字母是”+letter) count=count+1
- 请阅读下面的程序: count = 0 while count < 5: print(count, '小于5') if count == 2: break count += 1 else: print(count, "不小于5") 关于上述程序的说法中,描述错误的是