Search Header Logo

Quiz sobre Condicionais e Repetições

Computers

10th Grade

Used 1+ times

Quiz sobre Condicionais e Repetições
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das alternativas abaixo representa corretamente a estrutura básica de um laço while em Python?

`while (condição) { ... }`

`while condição: ...`

`enquanto condição faça ...`

`loop enquanto condição ...`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

O que acontece se a condição do laço while nunca for falsa?

O laço executa apenas uma vez.

O laço nunca executa.

O laço executa infinitamente.

O laço executa duas vezes.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Considere o seguinte código: ```python x = 0 while x < 3: x += 1 print(x) ``` Qual será o valor impresso?

0

2

3

4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das opções abaixo representa uma condição aninhada dentro de um laço while?

`if x > 0:`

`while x > 0: if y < 5: ...`

`for i in range(5):`

`print(x)`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

O que o seguinte código faz? ```python n = 5 while n > 0: if n % 2 == 0: print(n) n -= 1 ```

Imprime todos os números de 1 a 5.

Imprime apenas os números ímpares de 5 a 1.

Imprime apenas os números pares de 5 a 1.

Não imprime nada.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual é a saída do seguinte código? ```python x = 1 while x < 4: if x == 2: print("Dois") x += 1 ```

Dois

1 2 3

2

Dois Dois Dois

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das alternativas abaixo representa corretamente uma estrutura de repetição com condição aninhada?

`while x > 0: print(x)`

`while x > 0: if x % 2 == 0: print(x)`

`if x > 0: while x < 10: print(x)`

`print(x)`

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?