Skip to content

Latest commit

 

History

History
87 lines (60 loc) · 2.91 KB

README.md

File metadata and controls

87 lines (60 loc) · 2.91 KB

Second-Day

الجزء الاول

  • قم بعمل fork للـ repository
  • قم بعمل clone للـ repository
  • افتح ملف main.py
  • قم بانشاء variable باسم my_name وقيمته تكون input من المستخدم
  • قم بانشاء variable باسم my_age وقيمته تكون input من المستخدم
  • قم بطباعة الاتي:
My name is {flan} and I am {number} years old
  • flan & number is my_name & my_age

الجزء الثاني

  • قم بانشاء two variables باسم first_number & second_number

  • اطلب من المستخدم ادخال input باسم operation

  • باستخدام ال if condition تحقق من قيمة الـ operation اذا كانت:

    + اجمع الرقمين معاً
    - اطرح الرقم الاول من الثاني
    * اضرب الرقمين معاً
    / اقسم الرقم الاول من الثاني
    
  • اطبع الناتج بعد التحقق من الـ operation

  • قم بعمل validation على الـ input:

    • اذا كانت قيمة ال operation ليست احد العمليات الحسابية الاربعة (*,+,-,/) اطبع the operation is not valid

الجزء الثالث

  • اطلب من المستخدم ان يدخل رقم بين الـ 1 الى 12 ياستخدام input
  • اطلب من المستخدم ان يدخل noun ويجب ان يكون جمع (plural) مثال : dolls
  • اطلب من المستخدم ان يدخل اسمه
  • اطلب من المستخدم ان يدخل اي جملة
  • اطلب من المستخدم ان يدخل فعل (verb)
  • استخدم print statements لتطبع قصة كاملة مستخدمًا ال variables الذي ادخل المستخدم قيمتهم
تلميح: تستطيع استخدام اكثر من print statement واحدة لكتابة القصة على شكل اسطر

الـ output يجب ان يكون بهذا الشكل:

Mad libs where libs get mad.
Start below:

Enter a number from 1 to 12: 6
Enter a noun (plural): dolls
Enter a name: stephen sedoll
Enter any sentence: the future is made of dolls
Enter a verb: shake my head

The story goes...

It was 6 o'clock when I heard a knock at the door.
I opened the door and there was a box full of dolls with a note saying "From Mr. Stephen Sedoll."
Just as I closed the door I heard a scream "THE FUTURE IS MADE OF DOLLS."
I froze in place and all I could do was shake my head.