Question: In python3 anything but string indexing, lists, list indexing, or recursion no imports, but you can make as many helper functions as needed camelCase please


In python3
anything but string indexing, lists, list indexing, or recursion
no imports, but you can make as many helper functions as needed
camelCase please
hasConsecutiveDigits(n) [10 pts] Write the function hasConsecutive Digits(n) that takes a possibly-negative int n and returns True if somewhere in n some digit occurs consecutively (so the same digit occurs twice in a row), and False otherwise. For example, these numbers have consecutive digits: 11, -543661, 1200, -1200, and these numbers do not: 1, 123, 12321, -12321. print('Testing hasConsecutiveDigits (...', end='') assert(hasConsecutiveDigits() == False) assert(hasConsecutiveDigits(123456789) == false) assert(hasConsecutiveDigits(1212) == False) assert(hasConsecutiveDigits(1212111212) == True) assert(hasConsecutiveDigits (33) == True) assert(hasConsecutiveDigits(-1212111212) True) print('Passed.')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
