判断以下函数的功能
def func(str1):
s = Stack()
for char in str1:
s.push(char)
str2 = ''
while not s.isEmpty():
str2 += s.pop()
return str2
A、 判断给定字符串长度 B、 包含错误,无法运行 C、 将给定的字符串反转输出 D、 将给定字符串复制并输出
def func(str1):
s = Stack()
for char in str1:
s.push(char)
str2 = ''
while not s.isEmpty():
str2 += s.pop()
return str2