Intro to Python #6 | مقدمة إلى بايثون
- Computer Science
- Programming
- Python
- Intro to Python
#6: Lists & Loops | القوائم والحلقات
Lists are a very important data type in Programming. They represent a collection (or list) of items. For example: a list of numbers, a list of names, etc.
In Python, these items in a list do not have to all be of the same type. For example: a list can contain numbers, names, and other types at the same time.
Loops are a way of traversing these lists. Essentially saying: for every item in this list/collection -> do the following.
القوائم من أهم أنواع البيانات في البرمجة. القوائم تمثل مجموعة (أو قائمة) من الأشياء. على سبيل المثال: قائمة من الأرقام, قائمة أسامي, إلخ.
في بايثون, العناصر داخل القائمة ليس بالضروري أن يكونوا من نفس النوع. القائمة قد تحتوي على أرقام, أسامي و أنواع أخرى في نفس الوقت.
الحلقات تُستخدم عادة لاجتياز تلك الحلقات. مثلًا: لكل عنصر في تلك القائمة -> افعل الآتي.