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.
- Prepare
- Python
- Strings
- Merge the Tools!
- Discussions
Merge the Tools!
Merge the Tools!
Sort by
recency
|
2629 Discussions
|
Please Login in order to post a comment
import textwrap
def merge_the_tools(string, k): for i in range(0, len(string), k): substring = string[i: i + k] unique_char = ""
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)