Created
September 9, 2017 11:30
-
-
Save oddjobz/6cbdcde08c3c16403395310392108237 to your computer and use it in GitHub Desktop.
Code Test: return True if sequence appears in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isinarray_str(arr, seq): | |
return str(seq).strip('[]') in str(arr).strip('[]') | |
print(isinarray_str([1,2,3,4,5,6], [3,4])) | |
print(isinarray_str([1,2,3,4,5,6], [3,5])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment