برمجة 2: تحويل أنواع البيانات والعوامل

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

ما هي اسم الكلية المذكورة في النص؟

  • كلية الهندسة
  • كلية الذكاء الاصطناعي وعلم البيانات
  • كلية الهندسة وتقنيات المعلومات (correct)
  • كلية تكنولوجيا المعلومات

ما هو اسم القسم المذكور في النص؟

  • قسم هندسة الحاسوب
  • قسم علم البيانات
  • قسم الذكاء الاصطناعي
  • قسم الذكاء الاصطناعي وعلم البيانات (correct)

ما هو مستوى الدراسة المذكور في النص؟

  • مستوى ثالث
  • مستوى رابع
  • مستوى ثاني
  • مستوى اول (correct)

من هو أستاذ المحاضرة؟

<p>دكتور بلال السامعي (D)</p> Signup and view all the answers

ما هو العام الدراسي المذكور في النص؟

<p>2024-2025 (B)</p> Signup and view all the answers

ما هو نوع البيانات الناتج من int(2.2)؟

<p>عدد صحيح (C)</p> Signup and view all the answers

ما هو نوع البيانات الناتج من float(34)؟

<p>عدد عشري (B)</p> Signup and view all the answers

ما هي القيمة التي تُطبعها print(a, b, c)؟

<p>2 34 2.2 (A), 2 34 2.2 (B)</p> Signup and view all the answers

ما هو نوع البيانات الذي تم تعيينه للمتغير c في الكود المقدم؟

<p>عدد صحيح (C)</p> Signup and view all the answers

ما هي الطريقة المستخدمة لتحويل البيانات بين أنواع مختلفة في Python؟

<p>استخدام اسم نوع البيانات كدالة (A)</p> Signup and view all the answers

ما هو نوع بيانات المتغير f1؟

<p>مجموعة (tuple) (B)</p> Signup and view all the answers

ماذا سيطبع الكود print(type(c))؟

<p>خطأ (B)</p> Signup and view all the answers

ما هو العنصر الأخير في القائمة s؟

<p>gg (B)</p> Signup and view all the answers

ما هي أنواع المُشغّلات (Operators) التي تمّ ذكرها في النص؟

<p>كل ما سبق (C)</p> Signup and view all the answers

ما هو نوع المُشغّل "=" في لغة البرمجة؟

<p>مشغّل تعيين (D)</p> Signup and view all the answers

ما هو نوع البيانات المستخدم لتخزين قيم "صحيح" أو "خطأ"؟

<p>قيمة بولية (A)</p> Signup and view all the answers

ما هو الغرض من "صُنع القرار" في برمجة الحاسوب؟

<p>للتحكم في تدفق المعلومات (B)</p> Signup and view all the answers

Flashcards

tuple

تجميع غير قابل للتغيير من العناصر.

list

تجميع قابل للتغيير من العناصر.

set

تجميع غير مرتّب من العناصر الفريدة.

int

نوع بيانات يمثل الأعداد الصحيحة.

Signup and view all the flashcards

float

نوع بيانات يمثل الأعداد العشرية.

Signup and view all the flashcards

جامعة الجند

مؤسسة تعليمية عُليا تقدم تعليمًا جامعيًا.

Signup and view all the flashcards

كلية الهندسة وتقنيات المعلومات

قسم أكاديمي يدرس الهندسة وعلوم المعلومات.

Signup and view all the flashcards

قسم الذكاء الاصطناعي

قسم يركز على تطوير الأنظمة الذكية المحاكية للذكاء البشري.

Signup and view all the flashcards

علم البيانات

مجال يعنى بتحليل البيانات واستخراج المعلومات القيمة.

Signup and view all the flashcards

المحاضرة 3

الحصة الدراسية رقم 3 في مسار الدراسة.

Signup and view all the flashcards

تحويل البيانات

إجراء تغييرات على نوع البيانات في البرمجة.

Signup and view all the flashcards

str()

دالة لتحويل القيم إلى سلسلة نصية.

Signup and view all the flashcards

طباعة البيانات

إظهار النتائج على الشاشة باستخدام دالة print().

Signup and view all the flashcards

تحويل نوع البيانات

عملية تغيير نوع بيانات متغير إلى نوع آخر.

Signup and view all the flashcards

المشغلين الحسابيين

مشغلين يُستخدمون لإجراء العمليات الرياضية مثل الجمع والطرح.

Signup and view all the flashcards

المشغلين المقارنين

مشغلين يستخدمون لمقارنة قيمتين وإرجاع قيمة منطقية.

Signup and view all the flashcards

المشغلين المنطقيين

مشغلين يستخدمون لإجراء عمليات على القيم المنطقية (صحيح أو خاطئ).

Signup and view all the flashcards

هيكل القرار

طريقة تحدد مسار التنفيذ بناءً على شروط معينة.

Signup and view all the flashcards

نوع البيانات

يوضح نوع البيانات مثل قائمة أو عدد صحيح في بايثون.

Signup and view all the flashcards

print(type(c))

وظيفة تُستخدم لعرض نوع المتغير 'c'.

Signup and view all the flashcards

c = [1, 2, 3]

c هي قائمة تحتوي على أعداد صحيحة في بايثون.

Signup and view all the flashcards

استدعاء النوع

استخدام اسم النوع كدالة لتحويل البيانات.

Signup and view all the flashcards

Study Notes

Course Information

  • Course Title: Programming 2
  • Course Code: Programming 2
  • Department: Computer Engineering and Information Technology
  • Specialization: Artificial Intelligence and Data Science
  • Year: 2024-2035
  • Instructor: Dr. Bilal Al-Samaee

Data Type Conversion

  • Python allows converting data types
  • The type name is used as a function for conversion
  • Example: int(2.2), float(1), str(2.2), tuple(s), list(s), set(s)

Types of Operators

  • Python supports various operator types
  • Arithmetic Operators (+, -, *, /, %, **, //)
  • Comparison/Relational Operators (==, !=, >, <, >=, <=)
  • Assignment Operators (=, +=, -=, *=, /=, %=, **=, //=)
  • Logical Operators (and, or, not)
  • Bitwise Operators (&, |, ^, ~)
  • Python Identity Operators (is, is not)
  • Membership Operators (in, not in)
  • Boolean Operators (True, False)

Arithmetic Operators

  • Addition (+): 10 + 20 = 30
  • Subtraction (-): 20 - 10 = 10
  • Multiplication (*): 10 * 20 = 200
  • Division (/): 20 / 10 = 2
  • Modulus (%): 22 % 10 = 2
  • Exponent (**): 4 ** 2 = 16
  • Floor Division (//): 9 // 2 = 4

Comparison Operators

  • Equality (==): (3 == 4) is not true
  • Inequality (!=): (3 != 4) is true
  • Greater than (>): (3 > 4) is not true
  • Less than (<): (3 < 4) is true
  • Greater than or equal (>=): (3 >= 4) is not true
  • Less than or equal (<=): (3 <= 4) is true

Conditional Statements (Decision Making)

  • if statement: Executes code block if a condition is true.
  • if-else statement: Executes one block if true, another if false.
  • Nested if...else statements: if statements inside other if statements.
  • if-elif statement: A multi-condition check using elif for cases after the initial if.

Loop Statements

  • for loop: Repeats code a set number of times, or over an iterable object (list, tuple, etc.).
  • while loop: Repeats code as long as a condition is true.
  • Loop control statements (break, continue, pass): Control the flow of loops.

Useful Operators

  • range(): Generates sequences of numbers, with options for start, stop, and step values.

Homework Assignments

  • Various programming tasks with different requirements to utilize the learned concepts in this course. Include specific examples such as using range, list comprehensions, conditional statements, and loops. These will require writing Python code, and identifying the output values. Questions involving manipulating lists, strings, and mathematical calculations.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Python Basics Quiz
40 questions

Python Basics Quiz

AwedYtterbium avatar
AwedYtterbium
Python Data Types Quiz
37 questions

Python Data Types Quiz

SolicitousHeliotrope2966 avatar
SolicitousHeliotrope2966
Data Types in Python
8 questions

Data Types in Python

PoliteRealism3121 avatar
PoliteRealism3121
Python: Data Type Conversion
13 questions
Use Quizgecko on...
Browser
Browser