#!/usr/bin/env python # coding: utf-8 # In[1]: x = 12 # 104836 # In[2]: if x % 6 == 0: print('x is divisible by 6') elif x % 2 == 0: print('x is divisible by 2') elif x % 3 == 0: print('x is divisible by 3') else: print('x is not divisible by 2 or 3') # In[3]: if x % 6 == 0: with open('output.txt', 'w') as f: f.write('x is divisible by 6') elif x % 2 == 0: with open('output.txt', 'w') as f: f.write('x is divisible by 2') elif x % 3 == 0: with open('output.txt', 'w') as f: f.write('x is divisible by 3') else: with open('output.txt', 'w') as f: f.write('x is not divisible by 2 or 3') # In[ ]: