Skip to content

Commit dd3f5cd

Browse files
authored
gh-106318: Add examples for str.islower() docs (GH-144847)
1 parent c8d892e commit dd3f5cd

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

@@ -2620,7 +2637,10 @@ expression support in the :mod:`re` module).
26202637
False
26212638
>>> ' '.isupper()
26222639
False
2640+
>>> ''.isupper()
2641+
False
26232642

2643+
See also :meth:`islower` and :meth:`upper`.
26242644

26252645

26262646
.. _meth-str-join:

0 commit comments

Comments
 (0)