美文网首页
Python-3rd

Python-3rd

作者: 6龙 | 来源:发表于2022-01-18 21:09 被阅读0次

    while循环:

    1 无限循环

    while True:

        print("你是傻子")

    2. 计数循环

    count=1

    while count< =8:

        print("你是傻子")

        count=count+1

    3. while...break... 停止循环

    while True:

        s=input("请开始喷:")

        if s== 'q'

            break

        print("喷的内容是:"+s)

    4. while ... continue...停止当前循环,继续下一个循环

    while True:

        s= input("请开始喷:")

        if "马云" in s:

            print("你输入的内容和草泥马有一拼,不能输出")

            continue

        print("喷的内容是:"+s)

    相关文章

      网友评论

          本文标题:Python-3rd

          本文链接:https://www.haomeiwen.com/subject/iaclhrtx.html