Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. def main():
  2.     f = open('input.txt', 'r')
  3.     out = open('output.txt', 'w')
  4.  
  5.     amount_of_chars_in_line = int(f.readline())
  6.     first_line = f.readline()
  7.     first_line = first_line[:-1]
  8.     second_line = f.readline()
  9.     isComplementary = True
  10.  
  11.     for i in range(0, amount_of_chars_in_line):
  12.         if (first_line[i] == 'A' and second_line[i] == 'T') or (first_line[i] == 'G' and second_line[i] == 'C') or \
  13.                 (first_line[i] == 'C' and second_line[i] == 'G') or (first_line[i] == 'T' and second_line[i] == 'A'):
  14.             continue
  15.         else:
  16.             isComplementary = False
  17.             break
  18.  
  19.     out.write('Yes') if isComplementary else out.write('No')
  20.  
  21.     out.close()
  22.     f.close()
  23.  
  24. if __name__ == '__main__':
  25.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement