Run it! · รันเลย!
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
เริ่มต้นที่นี่
- บทเรียนคือรายการ ขั้นตอน สั้นๆ กด ดำเนินการต่อ (ลูกศรด้านล่าง) สำหรับขั้นตอนถัดไป
- หลังจากขั้นตอนจะมา งาน: โค้ดที่คุณแก้ไขและรัน
- วันนี้คุณพิมพ์น้อยมาก คุณเปลี่ยนเพียงเล็กน้อยทีละนิด
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
ปุ่มต่างๆ
- รัน ▶ รันโค้ด สิ่งที่พิมพ์ออกมาจะปรากฏในกล่องสีเข้มด้านล่าง
- ตรวจสอบคำตอบ ทดสอบโค้ดของคุณ สีเขียวหมายถึงถูกต้อง และคุณได้รับเหรียญ
- หลอดไฟ ให้คำแนะนำเมื่อคุณติดขัด
- รีเซ็ต นำโค้ดเริ่มต้นกลับมา
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
เมื่อเกิดข้อผิดพลาด
- หากโค้ดมีข้อผิดพลาด Python จะหยุดและแสดง ข้อความสีแดง
- ด้านล่างข้อความสีแดง การ์ดจะอธิบายข้อผิดพลาดเป็นภาษาอังกฤษและภาษาจีน พร้อมบอกคุณว่าให้ดูที่ บรรทัด ใด
- ข้อผิดพลาดเป็นเรื่องปกติ อ่านการ์ด แก้ไขหนึ่งอย่าง แล้วรันอีกครั้ง
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
เมื่อโปรแกรมรอให้คุณ
- บางโปรแกรมถามคำถามด้วย
input() - จากนั้นกล่องสีจะปรากฏขึ้น: พิมพ์ที่นี่ แล้วกด Enter
- คลิกที่กล่อง พิมพ์คำตอบของคุณแล้วกด Enter โปรแกรมจะดำเนินต่อไป
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
ลองดูเลย
- งานเล็กๆ สามงาน เปลี่ยนโค้ด กด รัน แล้ว ตรวจสอบคำตอบ
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer. · โปรแกรมนี้ปิดอยู่: # ที่ต้นบรรทัดทำให้บรรทัดนี้เป็นคอมเมนต์ ทำให้ Python ข้ามไป Delete # แล้วกด Run ▶ เพื่อดูผลลัพธ์ แล้วกด Check answer
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
Change one word so the program prints I like dogs. Only the text inside the quotes changes. · เปลี่ยน คำเดียว เพื่อให้โปรแกรมพิมพ์ I like dogs จะแก้ไขได้เฉพาะข้อความภายในเครื่องหมายอQuotes เท่านั้น
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello. · โปรแกรมนี้มีข้อผิดพลาด กด Run ▶ ก่อน แล้วอ่านการ์ดใต้ข้อความสีแดง: การ์ดจะอธิบายความผิดพลาด จากนั้นแก้ไขบรรทัดเพื่อให้โปรแกรมพิมพ์ Hello
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่