logo

Crowdly

Browser

Add to Chrome

Алгоритмізація та програмування КН

Looking for Алгоритмізація та програмування КН test answers and solutions? Browse our comprehensive collection of verified answers for Алгоритмізація та програмування КН at moodle.mnau.edu.ua.

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

Який з варіантів завершить наступну функцію, щоб вона повертала добуток всіх чисел?

def multiply(*args):

    result = 1

    for num in args:

        ________

    return result

0%
0%
0%
0%
View this question

Що поверне f.seek(0)?

0%
0%
0%
100%
View this question

Що буде результатом виклику функції?

def func(a, b=[]):

    b.append(a)

    return b

print(func(1))

print(func(2))

100%
0%
0%
0%
View this question

Як зробити функцію, яка кешує свої результати?

from functools import _______

@______

def expensive_function(x):

0%
0%
0%
100%
View this question

Як використати змінну з зовнішньої області вкладання, щоб змінити її у вкладеній функції?

def outer():

    x = 5

    def inner():

        _______

        x += 1

    inner()

    return x

0%
0%
0%
0%
View this question

Як зберегти список рядків у файл?

lines = ["one\\n", "two\\n"]

with open("out.txt", "w") as f:

    f.________(lines)

0%
0%
0%
0%
View this question

Що виведе код, якщо у файлі file.txt записано рядок "Hello"?

with open("file.txt", "r") as f:

    print(f.read(3))

0%
0%
0%
0%
View this question

Що буде результатом?

def f(x, y=2, z=3):

    return x + y + z

print(f(1, z=4))

0%
0%
0%
0%
View this question

Як правильно зчитати файл по рядках в циклі?

with open("file.txt") as f:

    for _______:

        print(line.strip())

0%
0%
0%
0%
View this question

Що поверне f.readline() при досягненні кінця файлу?

0%
100%
0%
0%
View this question

Want instant access to all verified answers on moodle.mnau.edu.ua?

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

Browser

Add to Chrome