Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Add two numbers you were given · ⁨บวกเลขสองตัวที่คุณได้รับมา⁩

English

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 เชื่อมข้อความแทนที่จะบวกตัวเลข

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP