O GoConqr está de visual novo! Conte para nós o que você achou.

Notas

for loop over a function

Sofia Sarachu Espanhol 1 página

Conteúdo das notas (1)

Página 1

for loop over a function

For Loop Over a Function

A for loop can also be used to execute a function multiple times. For example, below we are executing celsius_to_kelvin three times since there are three items in the iterating list:

def celsius_to_kelvin(cels):

return cels + 273.15

for temperature in [9.1, 8.8, -270.15]:

print(celsius_to_kelvin(temperature))

The output of that would be:

282.25

281.95

3.0

So, in the first iteration celsius_to_kelvin(9.1) was executed, in the second celsius_to_kelvin(8.8) and in the third celsius_to_kelvin(-270.15).

Contenido del curso

Contenido del curso

Descripción general

Notas

Anuncios

Valoraciones

Herramientas de aprendizaje

Informações

Descrição
Notas sobre for loop over a function, criado por Sofia Sarachu em 29-10-2024.
Criado por
Sofia Sarachu
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?