import week_4_homework as w4h

raise_to_5 = w4h.raise_to_power(5)
result = raise_to_5(5)
print(result)  # this should be 3125


filepath_a = 'C:/WORK/www/ai.huynhdous.com/UCI/Inter_Python/week_4/file_a.txt'
write_to_file_a = w4h.file_writer(filepath_a)
write_to_file_a('hey, this is text that will be written in file a')

filepath_b = 'C:/WORK/www/ai.huynhdous.com/UCI/Inter_Python/week_4/file_b.txt'
write_to_file_b = w4h.file_writer(filepath_b)
write_to_file_b( 'hey, this is text that will be writer in file b')


# Testing the function
test_filepath = "test_file.txt"    
print("First word of each line:")
for word in w4h.word_n_of_each_line(test_filepath):
	print(word)

# Test word_n_of_each_line for different values of n
for n in [2, 3, 5]:
	print(f"\n{n}th word of each line:")
	nth_word_generator = w4h.word_n_of_each_line(n)  # Get generator for nth word
	for word in nth_word_generator(test_filepath):
		print(word)






