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