+ 14

Dear sololearners! Give me a hint How to write my code better? thanks

This is the way how to make varieos kind of tree seeds https://code.sololearn.com/cZ1M3uboqb7E/?ref=app

3rd May 2019, 10:17 AM
PASHA from Russia 🇷🇺
PASHA  from Russia  🇷🇺 - avatar
2 ответов
+ 12
Dima, I could not use your advise. Бился целый день. А все оказалось проще. Теперь надо с "k" поработать, чтобы также, как "d" была переменной. Спасибо! Thanks! https://code.sololearn.com/cZ1M3uboqb7E/?ref=app
3rd May 2019, 2:10 PM
PASHA from Russia 🇷🇺
PASHA  from Russia  🇷🇺 - avatar
0
Everything that requires repetitive action is better to do in a cycle: while, for. Like so: int i=0 while i<d: t=k*z[:len(z)-d]. +k*z[len(z)-d:len(z)] print(t) i+=1
3rd May 2019, 11:33 AM
Dima Makieiev
Dima Makieiev - avatar