```
input = [10,18,20,5,11,2,10,15]
sum = 20
length = len(input)
for i in range(length):
for j in range(i+1, length):
if(input[i] + input[j] == sum):
print(input[i], input[j])
```

and the output is

```
10 10
18 2
5 15
```

We're a place where coders share, stay up-to-date and grow their careers.

```
input = [10,18,20,5,11,2,10,15]
sum = 20
length = len(input)
for i in range(length):
for j in range(i+1, length):
if(input[i] + input[j] == sum):
print(input[i], input[j])
```

and the output is

```
10 10
18 2
5 15
```

For further actions, you may consider blocking this person and/or reporting abuse

Dhruv Rajkotia -

Vicki (she/they) -

Lewis Gentle -

Sm0ke -

## Discussion (1)

Another solution would be to use a map(or a dictionary in python, AFAIK) where each key would follow this rule: sum - list[i];