أساسيات البرمجة

A skill of Computer Science 101 in Academic Acceleration Tests. Practise it with explained questions, and review your mistakes until you master it.

Skill lessons

  • تتبع الشيفرة: المتغيرات والشروط والحلقات
    كيف تتتبع شيفرة مكتوبة بلغة وصفية سطرا سطرا، مع أولوية العمليات والقسمة الصحيحة والباقي وحلقات for و while.
    Sign up to read it

Solved examples

Pick your answer, then open the solution to see the right answer and its explanation.

Example 1
ما الذي يطبعه برنامج بايثون الآتي؟
x = 10
def g():
x = 5
return x
g()
print(x)
  1. Aيظهر خطأ في التنفيذ
  2. B15
  3. C10
  4. D5
Show the solution

Correct answer: C

المتغير x داخل الدالة متغير محلي مستقل عن المتغير العام، فلا يتغير x العام ويطبع 10. اختيار 5 يخلط بين النطاق المحلي والنطاق العام.

Other skills in Computer Science 101

تدرّب على أساسيات البرمجة

Start with a free diagnostic test that measures your level in every skill, then practise what you need most.

Create your account and start free
Start the free diagnostic