简体   繁体   English

我怎样才能在循环中做一个循环我想在什么时候退出

[英]How can I do a loop in the loop i want to do a exit when

I want to do a loop in python and how can i do a exit when?我想在 python 中做一个循环,我怎样才能在什么时候退出?

In Turing what I want is在图灵我想要的是

loop
    put " Voulez vous jouer au 6-49 si oui entrez 'commencer' et n'oubliez pas qu'une "
    put " partie coute 3$ " ..
    color (green)
    get word
    color (black)

    %Je clear l'ecrant
    cls
    put " Chargement en cour."
    delay (500)
    cls
    put " Chargement en cour.."
    delay (500)
    cls
    put " Chargement en cour..."
    delay (500)
    cls

    %Je fais certain que le joueur a ecrit commencer
    %Si il entre quelque choses d'autre que commencer le programme ne commence pas il demander de entre le mot commencer

    exit when word = "commencer"
end loop

Now I need to do in Python but I don't know how to do that can someone help me out plzzz????现在我需要用 Python 做,但我不知道该怎么做,有人可以帮我解决吗????

If I understand the semantics of the Turing code,如果我理解图灵代码的语义,

while True:
    ...
    if word == "commencer":
        break

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM