Skip to content

Instantly share code, notes, and snippets.

@0ex-d
Created October 14, 2016 20:39
Show Gist options
  • Save 0ex-d/7035c08ad74f359e2854a4d4a9caaefe to your computer and use it in GitHub Desktop.
Save 0ex-d/7035c08ad74f359e2854a4d4a9caaefe to your computer and use it in GitHub Desktop.
Given an array of ints, return True if the sequence.. 1, 3, 4 .. appears in the array somewhere
'''
Python code to compare arrays(lists) sequence
@author: Precious Kindo
Sample space: [1,3,4]
input: A is sample space
input: B is list to be compared against
Output: Bool
'''
def checkInt(A, B):
return bool(A in B) # return True or False
B = range(1,11) # Generate a range from 1-10
T = [checkInt(i,B) for i in [1,3,4]] # compare arrays(lists)
print(T) # print the result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment