repl.it
@HappyFakeboulde/

Letters 2 and 4 swapper

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
def lenSlice(text, length):
	return [text[i:i + length] for i in range(0, len(text), length)]
def swap(text):
	try:
		return text[0] + text[3] + text[2] + text[1]
	except IndexError:
		return text
print("".join([swap(x) for x in lenSlice(input("Eetnros mt ee tsf romssei gnwhti: "), 4)]))