Найти - Пользователи
Полная версия: Помогите тупому, же не манж па сис жур
Начало » Python для новичков » Помогите тупому, же не манж па сис жур
1
gailgin
Почему интерпретатор возвращает ‘x’?
gailgin
>>> text= ('iter',34,6,1,1,'ad','orthodox',)
>>> text
('iter', 34, 6, 1, 1, ‘ad’, ‘orthodox’)
>>> for text in text:
print(text)


iter
34
6
1
1
ad
orthodox
>>> for text in text:
print('text')


text
text
text
text
text
text
text
text
>>> text
'x'
4kpt_IV
Вы text переназначили в цикле. Перед последним циклом: text = orthodox. Вы прошли по orthodox и text = x (последнему элементу orthodox)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB