Operators
+ — Unary positive
Applies the unary positive operation. For ordinary int, float and complex values it preserves the numeric value, though +True produces an int. It is not a general conversion or copying operation. Custom __pos__ implementations can return a different object; Decimal unary plus, for example, is affected by its arithmetic context. Unary operators bind more tightly than multiplication but less tightly than a power on their right.
Formal Syntax & Structure
python syntaxpython
+operandParameters & Attributes
| Name | Type | Description |
|---|---|---|
| operand | number or supporting object | Value to transform. |
Return Value
number or custom result
Numeric result for supported built-in numbers; custom methods can return other objects.
Working Example
Example Snippetpython
print(+7)print(+-3)print(type(+True).__name__)