-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modul_4 #123
base: main
Are you sure you want to change the base?
modul_4 #123
Conversation
print(len(word)) # узнал сколько в слове символов | ||
|
||
for el in range(len(word)): # перебрал слово в цикле | ||
print(el,[0,7]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что такое [0, 7]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[0, 7] - это список, который мы перебираем.
There was a problem hiding this comment.
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] == "а": #проверили каждую букву на соответствие букве а |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для чего нужна эта проверка с использованием el вне цикла?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не могу ответить, уже не помню.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот else должен относиться к вышестоящему if.
b = input("что - то понял, что - то нет: ") | ||
|
||
while b != "хватит": | ||
print(a[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Теперь надо вместо 0 использовать переменную и менять её, как Вы это делали в файле modul4_2.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Оставил замечания.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Часть замечаний исправлена, но часть осталась. Необходимо исправить.
No description provided.