Created
October 14, 2016 20:39
-
-
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
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
''' | |
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