Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

305 mg of C6H12O6 in 55.2 mL of solution whats the molarity

Answered: 1 week ago