Skip to content
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

Lesson 2 #1801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Lesson 2 #1801

wants to merge 1 commit into from

Conversation

MeXaHu3M
Copy link

No description provided.


lst = [423, "second", 453.43, False, None, [12, 23]]
for i in range(len(lst)):
print(type(lst[i]))
Copy link
Owner

Choose a reason for hiding this comment

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

нужно проще
for el in lst:
print(type(el))

lst[i * 2] = lst[i * 2] + lst[i * 2 + 1]
lst[i * 2 + 1] = lst[i * 2] - lst[i * 2 + 1]
lst[i * 2] = lst[i * 2] - lst[i * 2 + 1]
print(lst)
Copy link
Owner

Choose a reason for hiding this comment

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

выполнено

lst = ['', 'Зима', 'Зима', "Весна", 'Весна', 'Весна', 'Лето', 'Лето', 'Лето', 'Осень', 'Осень', 'Осень', 'Зима']
month_number = int(input("Введите номер месяца: "))
print(dct[month_number])
print(lst[month_number])
Copy link
Owner

Choose a reason for hiding this comment

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

'',
?? для чего

Copy link
Owner

Choose a reason for hiding this comment

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

month = int(input("Введите номер месяца: "))

my_lst = [
"Зима",
"Зима",
"Весна",
"Весна",
"Весна",
"Лето",
"Лето",
"Лето",
"Осень",
"Осень",
"Осень",
"Зима"]

print(f'Результат через список: {my_lst[month - 1]}')

my_dict = {1: "Зима", 2: "Зима", 3: "Весна", 4: "Весна", 5: "Весна",
6: "Лето", 7: "Лето", 8: "Лето", 9: "Осень", 10: "Осень",
11: "Осень", 12: "Зима"}

print(f'Результат через словарь: {my_dict.get(month)}')

prompt = 0
for i in input("Введите слова через пробел: ").split():
prompt += 1
print(f"{prompt}. {i[:10]}")
Copy link
Owner

Choose a reason for hiding this comment

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

здесь нужна ф-ция enumerate

if my_list[i] < new_number:
my_list.insert(i, new_number)
break
print(my_list)
Copy link
Owner

Choose a reason for hiding this comment

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

выполнено

print(f'"цены": {list(result["цены"])},')
print(f'"количества": {list(result["количества"])},')
print(f'"ед": {list(result["ед"])}'.replace("'", '"'))
print('}')
Copy link
Owner

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