Skip to content

Commit 842458e

Browse files
adorilsonmiss-islington
authored andcommitted
gh-106318: Add examples for str.islower() docs (GH-144847)
(cherry picked from commit dd3f5cd) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
1 parent 778679d commit 842458e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎Doc/builtins/stdtypes.rst‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,6 +2508,23 @@ expression support in the :mod:`re` module).
25082508
Return ``True`` if all cased characters [4]_ in the string are lowercase and
25092509
there is at least one cased character, ``False`` otherwise.
25102510

2511+
For example:
2512+
2513+
.. doctest::
2514+
2515+
>>> 'banana'.islower()
2516+
True
2517+
>>> 'BANANA'.islower()
2518+
False
2519+
>>> 'baNana'.islower()
2520+
False
2521+
>>> ' '.islower()
2522+
False
2523+
>>> ''.islower()
2524+
False
2525+
2526+
See also :meth:`isupper` and :meth:`lower`.
2527+
25112528

25122529
.. method:: str.isnumeric()
25132530

@@ -2624,7 +2641,10 @@ expression support in the :mod:`re` module).
26242641
False
26252642
>>> ' '.isupper()
26262643
False
2644+
>>> ''.isupper()
2645+
False
26272646

2647+
See also :meth:`islower` and :meth:`upper`.
26282648

26292649

26302650
.. _meth-str-join:

0 commit comments

Comments
 (0)