Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started