Language: Python
Problem summary: I was at practice rotate string on HackerRank https://www.hackerrank.com/challenges/rotate-string/problem and I was coding there on the page and it was telling me that I had a lot of errors. One was Parse error in pattern: def. But this error and all other errors did not appear when I transferred the code to IDLE.
What I've tried: I then decided to transfer the code I had done to a python editor IDLE that I was using and then there were no errors and the code worked (almost as intended-I'm still working on it).
This is the same code that I did on the HackerRank page (I know it's not complete yet-I'm a beginner):
def printrotation(S):
n = len(S)
temp = S + S
for i in range(n):
for j in range(n):
print(temp[i + j], end = ' ')
print()
S = 'cat'
printrotation(S)
Question: Why did I get so many errors for the same code that I placed in IDLE on the page at HackerRank?