python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
a = input() al = 'ABCDEFGH' idx11 = int(a[1]) idx12 = int(a[4]) idx21 = al.index(a[0])+1 idx22 = al.index(a[3])+1 if (abs(idx11-idx12)!=2 or abs(idx22-idx21)!=1) or(abs(idx11-idx12)!=2 or abs(idx22-idx21)!=1) : print('NO') else: print('YES')
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up