Computer Science, asked by aditirastogi29, 5 months ago

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 khushi7190
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