-
Notifications
You must be signed in to change notification settings - Fork 337
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
base: master
Are you sure you want to change the base?
Lesson 2 #1801
Conversation
|
||
lst = [423, "second", 453.43, False, None, [12, 23]] | ||
for i in range(len(lst)): | ||
print(type(lst[i])) |
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.
нужно проще
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) |
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.
выполнено
lst = ['', 'Зима', 'Зима', "Весна", 'Весна', 'Весна', 'Лето', 'Лето', 'Лето', 'Осень', 'Осень', 'Осень', 'Зима'] | ||
month_number = int(input("Введите номер месяца: ")) | ||
print(dct[month_number]) | ||
print(lst[month_number]) |
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.
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]}") |
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.
здесь нужна ф-ция enumerate
if my_list[i] < new_number: | ||
my_list.insert(i, new_number) | ||
break | ||
print(my_list) |
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.
выполнено
print(f'"цены": {list(result["цены"])},') | ||
print(f'"количества": {list(result["количества"])},') | ||
print(f'"ед": {list(result["ед"])}'.replace("'", '"')) | ||
print('}') |
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.