Buscar

In the given example, the air conditioner will always be activated with the message to the user 'turning on the air conditioner'. It will be adjust...

In the given example, the air conditioner will always be activated with the message to the user 'turning on the air conditioner'. It will be adjusted to summer, notifying the user with the message 'hot environment, adjusting air conditioner for summer weather', if the temperature is greater than 25º, or it will be adjusted to winter, notifying the user with the message 'cold environment, adjusting air conditioner for winter weather', if the temperature is less than or equal to 25º. In this example, we should use the conditional structure:


a. If....up.
b. if... else.
c. If....out.
d. Simple if.
e. Out...else.

Essa pergunta também está no material:

PROVA DE PYTON 01 06 23
7 pág.

Engenharia Mecânica

💡 1 Resposta

User badge image

Ed Verified user icon

Nesse exemplo, devemos utilizar a estrutura condicional "if...else". Dessa forma, podemos verificar se a temperatura é maior que 25º e, caso seja, exibir a mensagem "hot environment, adjusting air conditioner for summer weather" e ajustar o ar condicionado para o verão. Caso contrário, exibimos a mensagem "cold environment, adjusting air conditioner for winter weather" e ajustamos o ar condicionado para o inverno.

0
Dislike0

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais