logo

Crowdly

Python. Быстрый старт

Looking for Python. Быстрый старт test answers and solutions? Browse our comprehensive collection of verified answers for Python. Быстрый старт at edu.digtlab.ru.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Дан фрагмент программного кода

a = ['foo', 'bar', ('baz', 'qux'), 'corge', ('sky', 'sun', 'star')]

i = j = 0

while i < len(a):

    if type(a[i]) == tuple:

        while j < len(a[i]):

            print(a[i][j], end=' ')

            j += 1

        j = 0

    i += 1

который выводит …

View this question

Для того, чтобы не прерывать цикл, но пропустить очередную итерацию используется команда …

0%
0%
0%
0%
0%
View this question

Дан фрагмент кода

lst1 = lst2 = [2, 0, 1, 3, 10, 14, 45, -12, -23, 9]

for i in range(len(lst2)):

    if lst2[i] % 2:

        lst2[i] = lst2[i] % 5

print(lst1 + lst2)

в процессе его выполнения будет выведен список …

View this question

Дан следующий фрагмент кода

lst = [56, 14, 9, 11, 100, 10, 19, 21, 22, 99, 45, 12]

for i in range(len(lst)):

    if not lst[i] % 2 and i > 5:

        print(lst[i])

 

В процессе его выполнения будет выведено … значения.

View this question

Какие из примеров объявления цикла for в Python являются некорректными?

0%
0%
0%
View this question

Дан фрагмент программного кода

lst = [3, 1, 2, 2]

s = 'l'

for i in lst:

    s = s * i

print(s)

При его выполнении будет выведено … символов.

View this question

Дан фрагмент кода

a = 5

i = 1

t = i / a

while i < a:

    print(t, end=’ ’)

    t = t + 1/a

    i += 1

В результате выполнения кода будет выводится числовой ряд 0.2 0.4 … Продолжите его

View this question

Дан фрагмент кода

a = 'Hello world!'

i = len(a) - 1

while i >= 0:

    print(a[i], end = ' ')

    i -= 1

Какой индекс будет иметь символ пробела в данном случае?

View this question

Рассмотрите фрагмент программного кода

a = ['food', 'games', 'drink', 'cinema', 'buying', 'cake']

i = 0

while i < len(a):

    print(a[i])

здесь организован бесконечный цикл. Что необходимо предпринять, чтобы избежать бесконечного цикла?

View this question

Дан фрагмент программного кода

list_example = ['food', 'hobby', 'run', 'book', 'game']

i = 0

while i < len(list_example):

    if list_example:

        print(list_example[i])

        break 

else:

    print(list_example)

в результате его выполнения получим ...

View this question

Want instant access to all verified answers on edu.digtlab.ru?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!