Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Last active June 27, 2016 21:40
Show Gist options
  • Save codeboy101/a467ce21d065d57862c0 to your computer and use it in GitHub Desktop.
Save codeboy101/a467ce21d065d57862c0 to your computer and use it in GitHub Desktop.
numbers_in_file = []
with open('numbersTest.txt') as file : ## the contents of the text file are exactly as follows , without the quotations and the arrow --> " 3 5 8"
x = file.read()
for i in x :
numbers_in_file.append(i)
del numbers_in_file[1]
del numbers_in_file[2]
int_3 = int(numbers_in_file[0])
int_5 = int(numbers_in_file[1])
concat_double_val = str(numbers_in_file[2] + numbers_in_file[3] )
ranger = int(concat_double_val)
for i in range(1,ranger) :
if i % 3 == 0 and i % 5 == 0 :
print("fizzbuzz")
elif i % 3 == 0 :
print("fizz")
elif i % 5 == 0 :
print("buzz")
else :
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment