Предмет: Информатика, автор: passwo929394

Дано послідовність чисел. Визначити кількість членів порядкові номери яких парні, і є непарними числами НУЖЕН АЛГОРИТМ ​

Ответы

Автор ответа: H999
1

Ответ:

Код:

spisok = [1, 2, 3, 4, 5, 6, 8, 9, 10] #️список

spisok2 = spisok[::2]  #️список лишь с четным индексом

sum = 0 #️создали переменную для подсчета элементов

for i in spisok2: #️ перебираем элементы в списке 2

   if i % 2 == 0 : #️ если при деление на 2 нет остатка

       sum = sum + 1 #️ то к переменной sum + 1

print("Всего", sum, "четных чисел с четным порядковым номером")

Объяснение:

Алгоритм смотри по коду

Приложения:

passwo929394: не понял
H999: Что именно?
passwo929394: все( мне хотелось бы 2д рисунок простенький
H999: Тебе нужна блок схема?
H999: Минуту сейчас нарисую
passwo929394: да, блок схема
Интересные вопросы
Предмет: Английский язык, автор: dandrusechko
Exercise 108. Supply the Past Simple or the Past Perfect. Translate the sentences. a) When I was 20, I ... to Leningrad to study English. (to go). At that time I thought I ... English quite well because I ... it for nearly ten years (to know, to study). I... already... my studies at the evening classes of Foreign Languages in our town. (to finish) In fact I ... the highest mark at the final examination (to get). I... to Leningrad in August (to come). I ... never ... to a big city, so everything me very much. (to be, to interest) I ... a taxi and ... straight to the hostel where I wasto stay till the end of the entrance examinations (to take, to go). When 1 my luggage in my room, I... to go out to see Leningrad (to put, to decide). 1... never... such a beautiful city before! (to see) After I... around for an hour, I... my way. (to walk, to lose) I... a militiaman and... him that 1... my way. (to find, to tell, to lose) He me the way to the hostel (to show). It turned out that during the past hour I .... round in a circle, and I... quite near the hostel again! (to walk, to be)

b) 1. 1... to enter the philological faculty after I... to a friend of mine, who is a student of the English department. (to decide, to speak) 2. By the time I ... to the University, the meeting... already.... (to get, to begin) 3. After I... the entrance examinations, I... a student of Leningrad University (to pass, to become) 4. 1 the true state of affairs even before I ... your letter (to understand, to read). 5. After I ... all the books on the reading-list, I... that I was prepared for the examination (to read, to decide) 6. He... to our house before I ... breakfast, (to come round, to finish) 7. We ... everything by the time the taxi.... (to pack, to arrive) 8. After I... the library, I. the reader's membership card (to join, to get).​