0

Can you find the error? Its showing 'a' as invalid syntax.

https://code.sololearn.com/cORJ13QsoH8P/?ref=app

5th Aug 2021, 2:36 AM
Santhos raj
Santhos raj - avatar
5 ответов
+ 3
def rotate(a,b): n=int(input('enter n')) a=a[n:]+a[:n] b=b[n:]+b[:n] print(a) print(b)
5th Aug 2021, 2:40 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
Dude why don't you read the error it's 100 times easier than reading the same thing in comment section
5th Aug 2021, 2:53 AM
Abs Sh
Abs Sh - avatar
+ 1
Hatsy Rei , in addition it would be great to add checking if n is in range of len(a), len(b). And if not: else: m= n%len(a) a=a[m:]+a[:m]
5th Aug 2021, 3:40 AM
Shadoff
Shadoff - avatar
0
Can I know what you want to implement?
5th Aug 2021, 2:41 AM
Atul [Inactive]
0
Atul [Inactive] I wanted to rotate two lists
5th Aug 2021, 2:54 AM
Santhos raj
Santhos raj - avatar