Python upper() Function: Convert Strings to Uppercase

The upper() function is a string method in Python that converts all letters in a string to uppercase. When this function is called, all lowercase letters in the original string will be converted to uppercase, while other characters remain unchanged. This function does not take any parameters. Here is an example of how to use the upper() function:

s = "Hello, World!"
s_upper = s.upper()
print(s_upper)  # 输出结果为: HELLO, WORLD!
bannerAds