Ask for a name · ถามชื่อ
Ask for a name
input() reads one line that the user types. Store it in a box, then use it.
When you press Run, the program waits: a highlighted box appears under the code. Type a name there and press Enter. Check answer types Sam for you.
ขอชื่อ
input() อ่านบรรทัดที่ผู้ใช้พิมพ์มา เก็บไว้ในกล่อง แล้วนำไปใช้
เมื่อคุณกด Run โปรแกรมจะรอ: จะปรากฏกล่องสีอยู่ใต้โค้ด พิมพ์ชื่อลงไปในนั้นแล้วกด Enter. Check answer จะพิมพ์ Sam ให้คุณอัตโนมัติ
Read a name with input(). Then show Hi, + the name + !. For Sam, show Hi, Sam!. · อ่านชื่อด้วย input() จากนั้นแสดง Hi, + ชื่อ + ! สำหรับ Sam แสดง **Hi, Sam!**
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่