我试图使用字符串方法在一个包含三个不同字符串的列表中以三种不同的方式打印给定的字符串。是否有办法将这些字符串转换为方法以便在循环迭代期间使用?
some_string = "hello people!"
string_operations = [".upper()", ".lower()", ".capitalize()"]
for methods in string_operations:
print(some_string+methods)