We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My solutions are aparently the same but the tester says that they are wrong, if someone can give me an answer.(I know my code is not elegant but anyway......):
def string_apl(string, k):
string=string.upper()
count = int(len(string))
sub_len= int(count/k)
string2= []
string3= []
for i in range(k):
string2.append(string[i * sub_len : (i + 1) * sub_len])
for palabra in string2:
palabra_nueva=''
for letra in palabra:
if letra not in palabra_nueva:
palabra_nueva += letra
string3.append(palabra_nueva)
for item in string3:
print(item)
Merge the Tools!
You are viewing a single comment's thread. Return to all comments →
My solutions are aparently the same but the tester says that they are wrong, if someone can give me an answer.(I know my code is not elegant but anyway......):
def string_apl(string, k): string=string.upper() count = int(len(string)) sub_len= int(count/k) string2= [] string3= [] for i in range(k): string2.append(string[i * sub_len : (i + 1) * sub_len])
string = input() k= int(input()) var= string_apl(string, k)