My Code is below. I want to count the letters in the output
s = string and n is number of times to repeat. n = 10, means the string s = "aba" is repeated over the course of 10 letters. i.e abaabaabaa.
s, n = input().strip(), int(input().strip())
print(s.count("a")
Out = 7
my code is below
a = 'aba'
t = list(a)
n = 3
new_list = []
if n <= len(t):
for i in range(n):
new_list.append(t[i])
m = t + new_list
print (''.join(m))
elif n > len(t):
x,y = divmod(n,len(t))
if y == 0:
new_list.append(a * x)
else:
new_list.append((a * x) + ''.join(map(str,t[:y])))
if n is large then need to loop like len(list(s)) = 3, if n = 10, divide 10/3 and we got 3 equal part and we got 1 remainder