python入门:while循环里面True和False的作用,真和假

 1 #!/usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 #while循环里面True和False的作用,真和假
 4 """
 5 n1等于真(True),while循环开始,print字符串“1“,
 6 接着n1重新赋值为False(假),
 7 条件不再成立,所以跳出while循环,执行print字符串“end“
 8 """
 9 n1 = True
10 while n1:
11     print("1")
12     n1 = False
13 print("end")