0

Here's what I have:

def reverse(text): opposite = [] for character in text: stuff = opposite.append(character) return stuff

Is there something wrong with this for loop?

user8669
  • 133
  • 1
  • 8

2 Answers2

0

Couldn't you use the split method instead it will return a list

text.split()

Or even

list(text)

Which would list out each character

Zoidburg
  • 159
  • 8
0
yourstring='welcome'
l=[]
for char in yourstring:
      l.append(char)
print l
Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115