在Python中,可以使用upper()函数将小写字母转化为大写字母。
以下是一个示例:
# 将小写字母转化为大写字母
string = 'hello world'
uppercase_string = string.upper()
print(uppercase_string)
输出结果为:
HELLO WORLD
在上面的示例中,upper()函数用于将字符串string中的小写字母转化为大写字母,并将结果赋值给变量uppercase_string。然后,使用print()函数将结果打印出来。