[ Web Proxy ]
URL:
Viewing: https://mofanpy.com/tutorials/python-basic/basic/while [Back]  [Original]

while | Python while [while ]

x AI


while

: : : 2016-01-01

Python while for while

while while

while condition: expressions

condition Python True False True exexpressions , while

0 - 9 ,

condition = 0 while condition < 10: print(condition) condition = condition + 1

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, condition 0 while 0 < 10 True, while condition 1 condition 10 True, condiiton 10 condition < 10 False while 10

while while

while True: print("I'm True")

I'm True, ctrl + c

Python + <) + (>) + (<=) + (>=) + (==) + (!=)

True False True False

1

Boolean , 0 0.0 False True

condiiton = 10 while condiiton: print(condiiton) condiiton -= 1

10, 9, 8, 7, 6, 5, 4, 3, 2, 1, condition while 0 True, condition 0 False

2 None

while None, False

3

Python list tuple dict set while 0 False, True

a = range(10) while a: print(a[-1]) a = a[:len(a)-1]

9, 8, 7, 6, 5, 4, 3, 2, 1, 0,


:

""

wechat [wechat]
    []

    Python

    :



    Email: mofanpy@hotmail.com

    © 2022 mofanpy.com All Rights Reserved ICP20060366


    Web Proxy Viewer  |  New URL  |  Original Page