Add two numbers you were given · บวกเลขสองตัวที่คุณได้รับมา
Add two numbers you were given
Read two whole numbers, one per line, and print their total. For 3 and 4, print 7.
Two reads, two int(...), then one +. Forget one int and you get 34 instead of 7 — Python joined the text rather than adding the numbers.
เพิ่มตัวเลขสองตัวที่คุณได้รับมา
อ่านจำนวนเต็มสองจำนวน แยกกันบรรทัด แล้วพิมพ์ผลรวม สำหรับ 3 และ 4 ให้พิมพ์ 7
อ่านข้อมูลสองครั้ง มีตัวแปร int(...) สองตัว จากนั้นมี + ตัวเดียว ลืม int ตัวหนึ่งแล้วจะได้ 34 แทนที่จะได้ 7 — Python เชื่อมข้อความแทนที่จะบวกตัวเลข
Read two whole numbers, one per line, and print their total. For 3 and 4, print 7. · อ่านจำนวนเต็มสองจำนวน แยกกันบรรทัด แล้วพิมพ์ผลรวม สำหรับ 3 และ 4 ให้พิมพ์ 7
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่