logo

Crowdly

Browser

Add to Chrome

M122 (OI) - Automatizzare dei processi attraverso un linguaggio di script

Looking for M122 (OI) - Automatizzare dei processi attraverso un linguaggio di script test answers and solutions? Browse our comprehensive collection of verified answers for M122 (OI) - Automatizzare dei processi attraverso un linguaggio di script at moodle.edu.ti.ch.

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

Quale sarà il valore finale di?

x=0

for i in range(1, 5):

    x+=i    

print(x)

View this question

Quale sarà il valore di x alla fine?

x = 0

while x < 5:

    x += 1

View this question

Completa la funzione in modo che restituisca la somma dei numeri in una lista.

def somma(lista):

    totale = 0

    for n in lista:

        totale +=

    return totale

View this question

Qual è il risultato dell’esecuzione del seguente codice?

lista = [3, 5, 7]

lista.append(9)

print(lista)

View this question
Cosa stampa questo codice?

def somma(a, b=2):

    return a + b

print(somma(3))

View this question
In che modo posso chiamare la funzione moltiplica definita qui sotto?

def moltiplica(a, b=2):

    return a * b

View this question

Cosa fa la seguente funzione?

def mistero(n):

    for i in range(2, n):

        if n % i == 0:

            return False

    return True

View this question

Quale sarà l'output del seguente codice?

def myFunction(n):

    ris = 0

    i = 1

    while i <= n:

        if i % 2 == 0:

            ris = ris+i

        i += 1

    return ris

print(myFunction(6))

View this question

Quale sarà l'output del seguente codice?

def saluta(nome, messaggio="Ciao"):

    return f"{messaggio}, {nome}!"

print(saluta("Anna"))

View this question

Cosa stamperà il seguente codice?

for i in range(1, 6, 2):

     print(i, end=" ")

Attenzione: end=" ", che trovate all'interno di print, serve semplicemente a fare in modo che dopo aver stampato non vada a capo

View this question

Want instant access to all verified answers on moodle.edu.ti.ch?

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

Browser

Add to Chrome