Skip to content

Conversation

@iezkiil
Copy link

@iezkiil iezkiil commented Nov 29, 2022

Основы языка Python
Урок 2. Встроенные типы и операции с ними


list_1 = [1, 45, 2.35, None, 'some_word', 0, 0x1d5e, 0b1011101010111101110001]
print(list_1)
for element in list_1: print(type(element))

Choose a reason for hiding this comment

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

for element in list_1: print(type(element))
нужно на разных строках

Copy link
Author

Choose a reason for hiding this comment

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

<class 'int'>
<class 'int'>
<class 'float'>
<class 'NoneType'>
<class 'str'>
<class 'int'>
<class 'int'>
<class 'int'>

у меня выводит на разных строках

list_2.insert((i - 1), list_2.pop(i))
print(list_2)
i = i + 2
print(i)

Choose a reason for hiding this comment

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

выполнено

j = 0
print(f"Вы выбрали {month_name[(month_number - 1)]}. Месяц {month_name[(month_number - 1)]} относится к времени года"
f" {sezon[j]}")

Choose a reason for hiding this comment

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

выполнено

#4. Пользователь вводит строку из нескольких слов, разделённых пробелами. Вывести каждое слово с новой строки.
# Строки нужно пронумеровать. Если слово длинное, выводить только первые 10 букв в слове.
phrase = input("Введите фразу из нескольких слов: ")
for i, s in enumerate(phrase.split()): print(i + 1, s[0:10])

Choose a reason for hiding this comment

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

print(i + 1, s[0:10])
на разных строках

Copy link
Author

Choose a reason for hiding this comment

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

1 Пользовате
2 вводит
3 строку
4 из
5 нескольких
6 слов,
7 разделённы
8 пробелами

Здесь тоже на разных строках

o += 1
my_range.insert(o, num_input)
print(my_range)

Choose a reason for hiding this comment

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

o
переменные с такими именами давать не принято

Copy link
Author

Choose a reason for hiding this comment

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

исправил на 'ii'

исправил задание 5, заменил имя переменной
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