💥 Traceback and Exceptions changes in Python (3.6 -> 3.11)
📒 3.6.14
* abbreviating long sequences of repeated lines in tracebacks.
📕 3.7.11
* async and await names are now reserved keywords (SyntaxError)
* PEP 479 is enabled for all code in Python 3.7
* raises a SyntaxError, as a generator expression always needs to be directly inside a set of parentheses and cannot have a comma on either side.
📗 3.8.11
* exists via a SIGINT whenever the KeyboardInterrupt is not caught after Ctrl-C.
📘 3.9.6
* Unexpected errors in calling the iter method are no longer masked by TypeError in the in operator.
* better performance for, and updated the message of ZeroDivisionError
* import() raises ImportError instead of ValueError, which used to occur when a relative import went past its top-level package.
📙 3.10.0b4
* more descriptions in traceback for SyntaxError, IndentationErrors, AttributeErrors and NameErrors.
* highlighted error.
📖 3.11.0a0
* selecting the main part where exception is raised from.
🆔 @raspberry_python
📒 3.6.14
* abbreviating long sequences of repeated lines in tracebacks.
📕 3.7.11
* async and await names are now reserved keywords (SyntaxError)
* PEP 479 is enabled for all code in Python 3.7
* raises a SyntaxError, as a generator expression always needs to be directly inside a set of parentheses and cannot have a comma on either side.
📗 3.8.11
* exists via a SIGINT whenever the KeyboardInterrupt is not caught after Ctrl-C.
📘 3.9.6
* Unexpected errors in calling the iter method are no longer masked by TypeError in the in operator.
* better performance for, and updated the message of ZeroDivisionError
* import() raises ImportError instead of ValueError, which used to occur when a relative import went past its top-level package.
📙 3.10.0b4
* more descriptions in traceback for SyntaxError, IndentationErrors, AttributeErrors and NameErrors.
* highlighted error.
📖 3.11.0a0
* selecting the main part where exception is raised from.
🆔 @raspberry_python
How to Match a Zip Code in Python using Regular Expressions
@raspberry_python
import re
string1= "11422 11422-7903 11598 11678787 11678-23 11723 11898-111 22222222-6666 14567-999999 11111-2222"
regex= re.compile(r"(\b\d{5}-\d{4}\b|\b\d{5}\b\s)")
matches= re.findall(regex, string1)
for i in matches:
print(i)
11422
11422-7903
11598
11723
11111-2222
@raspberry_python
خروجی کد بالا چیست؟؟
Final Results
33%
Type Error
36%
{1,'python',('abc','xyz'),True}
31%
{1,'python',('abc','xyz')}