From 31bc19174ff0e203059deb1b046067b42ad1dcef Mon Sep 17 00:00:00 2001 From: raviram Date: Wed, 12 Dec 2018 01:13:20 +0530 Subject: [PATCH] Added example of absolute value of complex number (#23638) --- guide/english/python/complex-numbers/index.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/guide/english/python/complex-numbers/index.md b/guide/english/python/complex-numbers/index.md index a4052981f1..fdb4edc5cd 100644 --- a/guide/english/python/complex-numbers/index.md +++ b/guide/english/python/complex-numbers/index.md @@ -56,4 +56,14 @@ A `string` can also be used as the argument. No second argument is allowed if a ```python >>> complex("1.1+3.5j") (1.1+3.5j) -``` \ No newline at end of file +``` +We can obtain the absolute value of a complex number using the abs() method in python. +```py +>>> a=2+3j +>>> abs(a) +3.605551275463989 +>>> b=-1+1j +>>> abs(b) +1.4142135623730951 +``` +