What is the usage of upper() in Python?
In Python, upper() is a string method that converts all the alphabetic characters in a string to uppercase. It returns a new string and does not modify the original string.
Here is an example using the upper() method:
string = "hello world"
print(string.upper()) # 输出 "HELLO WORLD"
It can be seen that the upper() method converts all alphabetic characters in the string to uppercase.