
打印1~20之间整数的方法:
1、使用for循环
for i in range(1,21): print(i,end=',')
输出结果
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
2、使用while循环
i= 1 while i <p>输出结果</p><pre class="brush:html;toolbar:false">1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
Python免费学习笔记(深入):立即使用
在学习笔记中,你将探索 Python 的核心概念和高级技巧!










