Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
You can change the number to string and use double for loop to loop through the string and if any of two chars are equal and are not in same position, break the loop and print "repetitive number!" else continue the loop and then if the loop is at the end, break and print "non-repetitive number!"
7th Jul 2020, 4:12 AM
Bot
Bot - avatar