Ask for two things · ขอข้อมูลสองอย่าง
Ask for two things
Read a colour, then an animal. Print them on one line with a space between: for red and fox, print "red fox".
Each input() reads ONE line, so two things need two calls — and each needs its own variable, or the second overwrites the first.
ขอสองอย่าง
อ่านสี, จากนั้นสัตว์. พิมพ์บนบรรทัดเดียวด้วยช่องว่างระหว่าง: สำหรับ red และ fox, พิมพ์ "red fox"
แต่ละ input() อ่าน ONE บรรทัด, ดังนั้นสองอย่างต้องใช้สอง call — และแต่ละอย่างต้องมีตัวแปรของตัวเอง, มิฉะนั้นอันที่สองจะทับอันแรก
Read a colour, then an animal. Print them on one line with a space between: for red and fox, print "red fox". · อ่านสี, จากนั้นสัตว์. พิมพ์บนบรรทัดเดียวด้วยช่องว่างระหว่าง: สำหรับ red และ fox, พิมพ์ "red fox"
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่