Convert single backtick code sections to triple backtick code sections for Arabic Guide articles (13 of 15) (#36240)
* fix: converted single to triple backticks13 * fix: added prefix Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: removed language in wrong place Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add language postfix Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: removed language in wrong place Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@@ -6,51 +6,56 @@ localeTitle: أرقام بيثون معقدة
|
||||
|
||||
يمكن إنشاء الجزء التخيلي من رقم مركب باستخدام حرفي تخيلي ، وينتج عن ذلك رقمًا معقدًا بجزء حقيقي من `0.0` :
|
||||
|
||||
`>>> a = 3.5j
|
||||
>>> type(a)
|
||||
<class 'complex'>
|
||||
>>> print(a)
|
||||
3.5j
|
||||
>>> a.real
|
||||
0.0
|
||||
>>> a.imag
|
||||
3.5
|
||||
`
|
||||
```python
|
||||
>>> a = 3.5j
|
||||
>>> type(a)
|
||||
<class 'complex'>
|
||||
>>> print(a)
|
||||
3.5j
|
||||
>>> a.real
|
||||
0.0
|
||||
>>> a.imag
|
||||
3.5
|
||||
```
|
||||
|
||||
لا يوجد حرفي لإنشاء رقم مركب بأجزاء حقيقية وغير وهمية. لإنشاء رقم مجمع حقيقي غير صفري ، أضف حرفيًا خياليًا إلى رقم نقطة عائمة:
|
||||
|
||||
`>>> a = 1.1 + 3.5j
|
||||
>>> type(a)
|
||||
<class 'complex'>
|
||||
>>> print(a)
|
||||
(1.1+3.5j)
|
||||
>>> a.real
|
||||
1.1
|
||||
>>> a.imag
|
||||
3.5
|
||||
`
|
||||
```python
|
||||
>>> a = 1.1 + 3.5j
|
||||
>>> type(a)
|
||||
<class 'complex'>
|
||||
>>> print(a)
|
||||
(1.1+3.5j)
|
||||
>>> a.real
|
||||
1.1
|
||||
>>> a.imag
|
||||
3.5
|
||||
```
|
||||
|
||||
أو استخدام [منشئ المعقد](https://docs.python.org/3/library/functions.html#complex) .
|
||||
|
||||
`class complex([real[, imag]])
|
||||
`
|
||||
```python
|
||||
class complex([real[, imag]])
|
||||
```
|
||||
|
||||
يمكن أن تكون الوسيطات المستخدمة في استدعاء المُنشئ المعقد من نوع رقمي (بما في ذلك `complex` ) لأي من المعلمتين:
|
||||
|
||||
`>>> complex(1, 1)
|
||||
(1+1j)
|
||||
>>> complex(1j, 1j)
|
||||
(-1+1j)
|
||||
>>> complex(1.1, 3.5)
|
||||
(1.1+3.5j)
|
||||
>>> complex(1.1)
|
||||
(1.1+0j)
|
||||
>>> complex(0, 3.5)
|
||||
3.5j
|
||||
`
|
||||
```python
|
||||
>>> complex(1, 1)
|
||||
(1+1j)
|
||||
>>> complex(1j, 1j)
|
||||
(-1+1j)
|
||||
>>> complex(1.1, 3.5)
|
||||
(1.1+3.5j)
|
||||
>>> complex(1.1)
|
||||
(1.1+0j)
|
||||
>>> complex(0, 3.5)
|
||||
3.5j
|
||||
```
|
||||
|
||||
A `string` يمكن أن تستخدم أيضا حجة. لا يُسمح بوسيطة ثانية إذا تم استخدام سلسلة كوسيطة
|
||||
|
||||
`>>> complex("1.1+3.5j")
|
||||
(1.1+3.5j)
|
||||
`
|
||||
```python
|
||||
>>> complex("1.1+3.5j")
|
||||
(1.1+3.5j)
|
||||
```
|
||||
Reference in New Issue
Block a user