repl.it
@mcparadip/

Rotatable Word™ Checker-1

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
while True:
    startstring = input("Enter Word™:").upper()
    endstring = ""
    counter = 1
    for i in startstring:
        try:
            endstring += alphabet[(alphabet.index(i)+counter)%26]
        except:
            endstring += i
        counter += 1
    for i in range(0, len(endstring)-1):
        if ((endstring[i] + endstring[i+1]) in alphabet) or ((endstring[i] + endstring[i+1]) in alphabet[::-1]):
            print(startstring, "is a Rotatable Word™.")
            break
    else:
        print(startstring, "is not a Rotatable Word™.")
Fetching token
?