I understand it is possible for you my methods seem primitive, but Python began to study only 3-4 days ago.
a = int(input()) b = list(map(int, input().split())) q = c = int(input()) w = [] p = 0 while q > 0: d= list(map(int, input().split())) w.extend(d) q -= 1 print(w) while c > 0: print(a[w[p]:w[p+1]:]) #на этом месте выдает ошибку:'int' object is not subscriptable c -= 1 p += 2
ais an integer. You probably wanted:print(b[w[p]:w[p+1]:]), becausebis a list and you will succeed) - S. Nick