ENع
الدرس 06 · First steps in code

Variables and types

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A program has to remember things: a score, a price, a name. It does that with variables, names that point to values stored in memory. Step through seven lines of Python and watch each value land in memory, get read back, get replaced, and see why the type of a value decides what + does.

9 دقيقة8 خطوات5 أسئلةBeginner
شكل 6 · تفاعلي
جارٍ تحميل الرسم…
أو ← →
طبّق ما تعلّمته

جرّب

0/2 تمارين ناجحة

Turn text into a number

The value "3" is text. Convert it to an integer before adding 4, so total is the number 7.

اضغط Ctrl/Cmd + Enter للتشغيل. يضيف Tab مسافة بادئة؛ واضغط Escape ثم Tab لمغادرة المحرّر.

جاهز
المخرجات
شغّل الشيفرة لرؤية مخرجاتها.
الاختبارات
  • تحقّق من الشيفرة عندما تكون مستعدًا.

اختبار يتاح بعد الخطوة الأخيرة.