stroka = "aaa/bbb/ccc"
limit = len(stroka)
for i in limit:
	if stroka[i] == '/':
		stroka[i] = " "
			
print stroka
#должно получиться  aaa bbb ccc
Что это за ошибка ?
for i in limit:
TypeError: iteration over non-sequence
RTFM!

text = 'aaa/bbb/ccc'
array_of_text = text.split('/')  # ['aaa', 'bbb', 'ccc']
text = ' '.join(array_of_text)   # 'aaa bbb ccc'
..bw

Last edited July 30, 2008, 4:49 p.m.

text = 'aaa/bbb/ccc'
text = text.replace('/', ' ')  # 'aaa bbb ccc'
..bw
nws
stroka = "aaa/bbb/ccc"
limit = len(stroka)
for i in limit:
	if stroka[i] == '/':
		stroka[i] = " "
			
print stroka
#должно получиться  aaa bbb ccc
Что это за ошибка ?
for i in limit:
TypeError: iteration over non-sequence
там должно быть то, среди чего перебирать. Например последовательность xrange

Last edited July 30, 2008, 5:38 p.m.

nws
stroka = "aaa/bbb/ccc"
limit = len(stroka)
for i in limit:
	if stroka[i] == '/':
		stroka[i] = " "
			
print stroka
#должно получиться  aaa bbb ccc
Что это за ошибка ?
for i in limit:
TypeError: iteration over non-sequence
Это не ошибка, это неумение читать документацию:
1) попытка итерации по числу
Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), Python's for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence.
2) попытка изменить строку
unlike a C string, Python strings cannot be changed. Assigning to an indexed position in the string results in an error
Be easy, stay cool
>>> stroka = "aaa/bbb/ccc"
>>> if stroka.find("/")!=-1:
... stroka.replace("/"," ")
... stroka.split(" ")

Last edited Feb. 28, 2009, 11:15 p.m.