Until you type stop · จนกว่าจะพิมพ์ stop
Until you type stop
Read words one at a time until the word stop arrives, then report how many came before it.
Read the first word before the loop, so the condition has something to test. Inside the loop, count the word and then read the next one. When you press Run, type each word and press Enter.
จนกว่าจะพิมพ์ stop
อ่านคำทีละคำจนกว่าคำว่า stop จะปรากฏขึ้น, จากนั้นรายงานว่ามี多少个 came before it (how many came before it).
อ่านคำแรก ก่อน ลูป, เพื่อให้เงื่อนไขมีอะไรให้ทดสอบ. ภายในลูป, นับคำนั้นแล้วอ่านคำถัดไป. เมื่อคุณกด Run, พิมพ์แต่ละคำแล้วกด Enter
Keep reading words with input() until the word is stop. Then print how many words came before stop. For the words cat, dog, stop, print 2. · อ่านคำที่มี input() ต่อเนื่องจนกว่าจะเจอคำที่เป็น stop จากนั้นพิมพ์จำนวนคำที่ปรากฏ ก่อน stop สำหรับคำ cat, dog, stop ให้พิมพ์ 2
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่