Skip to content

modul_4#123

Open
Ar87tem123456789101112 wants to merge 42 commits into
mainfrom
zadanie1
Open

modul_4#123
Ar87tem123456789101112 wants to merge 42 commits into
mainfrom
zadanie1

Conversation

@Ar87tem123456789101112
Copy link
Copy Markdown
Collaborator

No description provided.

markoffarteom_1987@mail.ru added 30 commits September 18, 2023 16:56
print(len(word)) # узнал сколько в слове символов

for el in range(len(word)): # перебрал слово в цикле
print(el,[0,7])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что такое [0, 7]?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[0, 7] - это список, который мы перебираем.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В задании требуется перебрать символы, которые у Вас записаны в переменной word.
Про перебор списка требования нет. Ну и собственно перебор этого списка здесь не делается. Просто вместе с каждой буквой слова "арзамас" зачем-то выводится "[0,7]".

print(el,[0,7])


if word[el] == "а": #проверили каждую букву на соответствие букве а
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для чего нужна эта проверка с использованием el вне цикла?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не могу ответить, уже не помню.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может быть, она просто не нужна? Тем более переменная el имеет смысл только внутри вышеуказанного цикла.

print(i)
if i % 15:
print("FizzBuzz")
else:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот else должен относиться к вышестоящему if.

Comment thread Practice/amarkov/modul4_1.py Outdated
Comment thread Practice/amarkov/exzample.py
b = input("что - то понял, что - то нет: ")

while b != "хватит":
print(a[0])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Теперь надо вместо 0 использовать переменную и менять её, как Вы это делали в файле modul4_2.py

Copy link
Copy Markdown
Owner

@IlyaOrlov IlyaOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оставил замечания.

Copy link
Copy Markdown
Owner

@IlyaOrlov IlyaOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Часть замечаний исправлена, но часть осталась. Необходимо исправить.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants