15,882,278 members
See more:
example:
e = ['6']['12']

i want to get ['6','12']

What I have tried:

ive tried join and extend functions but it didt'nt work
or I don't know if I made a mistake.
Posted
Updated 19-Jan-22 21:25pm
CPallini 20-Jan-22 3:03am
Are you sure
e = ['6']['12']
is valid Python syntax?
shri harshan 20-Jan-22 3:10am
yes i got a output like that the whole program is
a = int(input())
b = int(input())
c = int(input())
for i in range(a, b+1):
if i%c==0:
d = str(i)
e = d.split()
print(e,end=" ")

sample input:
5
15
6
output:
2

we need to count how many number are divible by c in range[a-b].

## Solution 1

Quote:
e = ['6']['12']
That's not valid `Python` syntax.

Quote:
yes i got a output like that the whole program is
a = int(input())
b = int(input())
c = int(input())
for i in range(a, b+1):
if i%c==0:
d = str(i)
e = d.split()
print(e,end=" ")
So it is just the output of a `Python` program.

Try
Python
```a = int(input())
b = int(input())
c = int(input())
l = []
for i in range(a, b+1):
if i%c==0:
l.append(str(i))
print(l)```