ٍٍTHE COURT OF COMPUTING SYSTEMS
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


The Court Of Computing Systems
 
الرئيسيةالرئيسية  البوابةالبوابة  أحدث الصورأحدث الصور  التسجيلالتسجيل  دخولدخول  
بحـث
 
 

نتائج البحث
 
Rechercher بحث متقدم
دخول
اسم العضو:
كلمة السر:
ادخلني بشكل آلي عند زيارتي مرة اخرى: 
:: لقد نسيت كلمة السر
المتواجدون الآن ؟
ككل هناك 2 عُضو متصل حالياً :: 0 عضو مُسجل, 0 عُضو مُختفي و 2 زائر

لا أحد

أكبر عدد للأعضاء المتواجدين في هذا المنتدى في نفس الوقت كان 22 بتاريخ السبت نوفمبر 11, 2023 7:29 pm
احصائيات
هذا المنتدى يتوفر على 269 عُضو.
آخر عُضو مُسجل هو Lona فمرحباً به.

أعضاؤنا قدموا 224 مساهمة في هذا المنتدى في 164 موضوع
المواضيع الأخيرة
» دائرة مكبر صوت من الميكروفون وحتى السماعة ... كامل التصميم
 assert -statement in python   Emptyالسبت ديسمبر 13, 2014 11:31 pm من طرف محمدهاشم

» python code to know current file name and path and directory
 assert -statement in python   Emptyالأحد أغسطس 12, 2012 12:47 pm من طرف 000000000000000

»  assert -statement in python
 assert -statement in python   Emptyالإثنين يوليو 02, 2012 3:12 am من طرف Admin

» Solving no-interface issue in Wireshark on Ubuntu 11.10
 assert -statement in python   Emptyالإثنين يوليو 02, 2012 2:36 am من طرف Admin

» python application slide
 assert -statement in python   Emptyالسبت يونيو 30, 2012 2:56 am من طرف Admin

» Google Developers Day US - Python Design Patterns
 assert -statement in python   Emptyالأربعاء يونيو 06, 2012 7:49 pm من طرف 000000000000000

» Google Developers Day US - Python Design Patterns
 assert -statement in python   Emptyالأربعاء يونيو 06, 2012 7:19 pm من طرف 000000000000000

» شرح بالعربي ومبسط Acess Control List
 assert -statement in python   Emptyالإثنين أبريل 16, 2012 5:59 am من طرف 000000000000000

» Cisco Packet Tracer on ubuntu
 assert -statement in python   Emptyالأربعاء مارس 14, 2012 2:06 pm من طرف Admin

تصويت

 

  assert -statement in python

اذهب الى الأسفل 
كاتب الموضوعرسالة
Admin
Admin
Admin


ذكر عدد المساهمات : 23
نقاط : 10044
تاريخ الميلاد : 04/01/1988
العمر : 36
الموقع : Palestine(Hebron-Nablus)x
العمل/الترفيه : Computer Engineering
المزاج : good

 assert -statement in python   Empty
مُساهمةموضوع: assert -statement in python     assert -statement in python   Emptyالإثنين يوليو 02, 2012 3:12 am

There is an even more advanced feature of the assert statement. If the expression evaluates to a class, that class is used instead of AssertionError. This is not widely used, and depends on elements of the language we haven't covered yet

Here's a typical example

max= 0
if a < b: max= b
if b < a: max= a
assert (max == a or max == b) and max >= a and max >= b

If the assertion condition is true, the program continues. If the assertion condition is false, the program raises an AssertionError exception and stops, showing the line where the problem was found

Run this program with a equal to b and not equal to zero; it will raise the AssertionError exception. Clearly, the if statements don't set max to the largest of a and b when a = b. There is a problem in the if statements, and the presence of the problem is revealed by the assertion
الرجوع الى أعلى الصفحة اذهب الى الأسفل
https://c-s-c.123.st
 
assert -statement in python
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» python application slide
» python to exe download book
» Google Developers Day US - Python Design Patterns
» Google Developers Day US - Python Design Patterns
» python code to know current file name and path and directory

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
ٍٍTHE COURT OF COMPUTING SYSTEMS  :: SOFTWARE :: PYTHON LANGUAGE-
انتقل الى: