标签: string python-3.x function uppercase lowercase
我应该如何定义一个接受字符串的函数,并根据偶数和奇数索引返回大写和小写的字符串?
def myfunc(string): for some in string: if string.index%2==0:
我写了这么多,但我不知道现在应该输入什么。
请帮忙。
答案 0 :(得分:0)
Here you can find the string methods请特别注意将在这里成为你朋友的upper()和lower()。