diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..172e882 --- /dev/null +++ b/data.txt @@ -0,0 +1 @@ +1 2 3 5 7 11 13 17 19 diff --git a/util.py b/util.py new file mode 100644 index 0000000..caa8ece --- /dev/null +++ b/util.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +from os import listdir + +def ls(): + print(listdir('.')) +def run_my_analysis(option, data): + """Run my analysis.""" + print('Reading data') + with open('/Users/tevesjb/repositories/code-review-practice-1/data.txt', 'r') as f: + data = f.read() + print('Read the data') + nums = [] + numbers = data.split() + for n in numbers: + nums.append(int(n)) + print('Checking data...') + for n in nums: + if option == 'False': + if (n / 2) == 0: + print('%d: True' % n) + else: + print('%d: False' % n) + else: + # Checking to see if even + if (n/2) == 0: + print('%d: False' % n) + else: + print('%d: True'%n) + print('Finished aanalysing data!') + + + + +def main(): + run_my_analysis('True', '/Users/tevesjb/repositories/code-review-practice-1') +if __name__ == '__main__': + main()