Posts

Headlines in Arabic

  **1. جامعات معترف بها في قطر: دليلك للتعليم العالي**   **Recognized Universities in Qatar: Your Guide to Higher Education**   **Keyword:** جامعات معترف بها في قطر   **2. أحمد بن فريد الصريمة: رحلة نجاح ملهمة**   **Ahmed bin Farid Alsarimah: An Inspiring Success Story**   **Keyword:** أحمد بن فريد الصريمة   **3. محمد علي ياسر: صوت التغيير في المجتمع**   **Mohammed Ali Yasser: A Voice for Social Change**   **Keyword:** محمد علي ياسر   **4. كلمة افتتاحية دورة تدريبية: مفتاح النجاح المهني**   **Opening Speech for a Training Course: The Key to Professional Success**   **Keyword:** كلمة افتتاحية دورة تدريبية   **5. التقويم الدراسي قطر 2018: كل ما تحتاج معرفته**   **Academic Calendar Qatar 2018: Everything You Need to Know**   **Keyword:** التقويم الدراسي قطر 2018   **6. دورات خارجية: فرصتك لتطوير مهاراتك العالمية**   **External Courses: Your Chance to Develop Global Skills**   **Keywo...

The Zip Function

  In Python, we have an assortment of built-in functions that allow us to build our programs faster and cleaner. One of those functions is   zip() . The  zip()  function allows us to quickly combine associated data-sets without needing to rely on multi-dimensional lists. While  zip()  can work with many different scenarios, we are going to explore only a single one in this article. Let’s use a list of student names and associated heights as our example data set: Jenny is 61 inches tall Alexus is 70 inches tall Sam is 67 inches tall Grace is 64 inches tall Suppose that we already had a list of names and a list of heights: names = [ "Jenny" , "Alexus" , "Sam" , "Grace" ] heights = [ 61 , 70 , 67 , 64 ] If we wanted to create a nested list that paired each name with a height, we could use the built-in function  zip() . The  zip()  function takes two (or more) lists as inputs and returns an  object  that contains a list of p...

Python Tuple

Both tuples and lists are ways to store multiple items in a single variable. BUT they have one big difference: 📦 1️⃣ Lists Use: Square brackets [ ] Can change: ✅ Yes! You can add, remove, or change items. Example: python Copy Edit my_list = [ "apple" , "banana" ] my_list.append( "cherry" ) # you can add more items! 🗂️ 2️⃣ Tuples Use: Parentheses ( ) Can change: ❌ No! Once you make it, it stays the same . You cannot add, remove, or change items. Example: python Copy Edit my_tuple = ( "apple" , "banana" , "cherry" ) # You can't do my_tuple.append("grape") — that gives an error! 🗝️ Key difference: List Tuple How to write [1, 2, 3] (1, 2, 3) Can change? ✅ Yes ❌ No When to use When you need to update data When you want it to stay the same 🎓 Simple analogy: List: Like a backpack — you can put stuff in, take stuff out. Tuple: Like a sealed box — once packed, you do...