upper() and lower()

String methods that return a copy of a string in capitals or in small letters.

In more detail

s.lower() is handy before comparing text typed by a user, so Yes and yes both match. Related methods are swapcase, title and capitalize. Each returns a new string and leaves s unchanged.

Example

"Hello".upper()   # "HELLO"

Related terms

Taught in

References

Certification courses