التسلسل، الإدخال والإخراج
تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
English
A program runs in order
- A program is a list of steps.
- Python runs them from top to bottom, one at a time.
- This order is called sequence — the first idea in the syllabus.

English
print("Wake up")
print("Brush teeth")
print("Go to school")
English
OUTPUT becomes print()
- In the exam, OUTPUT shows something on the screen.
- In Python, that is
print(). - The text inside the quotes is printed, then a new line starts.
English
print("Hello, world!")
print("IGCSE Computer Science")
English
INPUT becomes input()
- In the exam, INPUT reads what the user types.
- In Python, that is
input(). - It always gives back a string (text), even if the user types digits.
English
name = input()
print("Hello, " + name)
English
Turn input into a number
input()gives text, so"5"is not the number 5.- Wrap it with
int()to get a whole number. - Now you can do maths with it.
English
age = int(input())
print(age + 1)
English
In the exam: pseudocode
- The same idea in Cambridge pseudocode uses
INPUTandOUTPUT.
OUTPUT "What is your name?"
INPUT Name
OUTPUT "Hello, ", Name
English
Common mistakes
- Statements run from top to bottom, in the order you write them.
input()gives back text (a string); useint(...)when you need a number.
English
Now you try
- Use
print()to show output. - Use
input()to read a line — leave the brackets empty here. - Press Check answer to test your code.
استكشف
مدخلات ← معالجة ← مخرجات
معظم البرامج تتبع شكلاً واحداً: احصل على إدخال، افعل شيئاً، اعرض إخراجاً.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
اطبع هذه الأسطر الثلاثة، بالترتيب: Ready، ثم Set، ثم Go — سطر واحد لكل.
اضغط تشغيل لرؤية المخرجات هنا.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
اقرأ اسماً باستخدام input()، ثم اطبع Hello, ثم الاسم ثم !. بالنسبة للإدخال Sam، يجب أن يكون الإخراج Hello, Sam!.
اضغط تشغيل لرؤية المخرجات هنا.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
اقرأ عددًا صحيحًا باستخدام input()، وحوله باستخدام int(...)، ثم اطبعه مضاعفًا (في 2). بالنسبة للمدخل 6، يجب أن يكون المخرج 12.
اضغط تشغيل لرؤية المخرجات هنا.