0
Can you find the error? Its showing 'a' as invalid syntax.
5 Antworten
+ 3
def rotate(a,b):
n=int(input('enter n'))
a=a[n:]+a[:n]
b=b[n:]+b[:n]
print(a)
print(b)
+ 1
Dude why don't you read the error it's 100 times easier than reading the same thing in comment section
+ 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]
0
Can I know what you want to implement?
0
Atul [Inactive] I wanted to rotate two lists