From e68582a316dfaf5092313ced6e518e59f7ae5e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 19 Dec 2018 11:07:55 +0100 Subject: [PATCH] Image --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 55facc7..0c4b74f 100644 --- a/README.md +++ b/README.md @@ -885,9 +885,9 @@ Introspection and Metaprograming ### Variables ```python - = dir() # In scope variables. - = globals() # Global variables. + = dir() # In-scope variables. = locals() # Local variables. + = globals() # Global variables. ``` ### Attributes @@ -910,11 +910,11 @@ False ``` ### Parameters +#### Getting the number of parameters of a function: ```python ->>> from inspect import signature ->>> sig = signature() ->>> len(sig.parameters) -3 +from inspect import signature +sig = signature() +no_of_params = len(sig.parameters) ``` ### Type @@ -1104,7 +1104,7 @@ img.save('out.png') ``` ### Modes -* `1` - 1-bit pixels, black and white, stored with one pixel per byte +* `'1'` - 1-bit pixels, black and white, stored with one pixel per byte * `L` - 8-bit pixels, greyscale * `RGB` - 3x8-bit pixels, true color * `RGBA` - 4x8-bit pixels, true color with transparency mask