f. Determine the output of the following:
def compute(s):
x= []
for i in range(len(s)):
a = s[i]
b = a.upper()
if a not in x and b not in x:
if a > 'p':
X.append(a.upper())
else :
x.append(a)
return x
print(compute('abracadabra'))
Answers
Answered by
3
Explanation:
def myfunc(str1):
x=1
str2=''
for i in str1:
if x%2 != 0:
str2 = str2 + i.lower()
x=x+1
else:
str2 = str2 + i.upper()
x=x+1
return str2
Similar questions
English,
3 months ago
Math,
3 months ago
Math,
7 months ago
History,
7 months ago
Social Sciences,
11 months ago