9
Александр Колодяжный
Last seen 5 years ago
Member for 10 years, 4 days
Difficulty Normal
Hi monkshorin,
Thank your for publication and great code provided. Can you be so kind to tell how this trick called "[0::2]". I'm new in python and used old-school code (with for loop and counter variable to find even elements).
Thank you in advance.
Regards,
Olexander.Ukraine
More
Thank you for publication. endswith - is proper solution in this case.
But as for me "if statement" may be much shorter, like this:
if w1 != w2 and w1[::-1].find(w2[::-1]) == 0
{You reversed words and suffix and compared it)
Educational: [start:end:stride], and string function find()
More
Attention!!! Divmod() in action ;) Really Anti - Bicycle function.
Well done!!!
More