Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define the values
- x = 3
- y = 5
- # Create a file
- f = open('C:\Users\user_name\My Documents\python.txt', 'w')
- n = x
- while n < 1000: # Until the multiples reach 1000, this keeps going
- f.write(n) # Writes each result to the text file
- n += x
- f.write("End of 3") # This signifies the end of the multiples of 3 in the file
- n = y
- while n < 1000: # Same thing as above
- f.write(n)
- n += y
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement