Search Header Logo

Python Quiz

Authored by TATIANE TONET LUGLI

Computers

12th Grade

Used 1+ times

Python Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual é a maneira correta de declarar uma variável em Python?

`var = 10`

`int var = 10`

`10 = var`

`variable int = 10`

Answer explanation

A maneira correta de declarar uma variável em Python é `var = 10`, onde o nome da variável vem primeiro seguido pelo sinal de igual e o valor atribuído.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das seguintes opções é uma estrutura de dados em Python?

`int`

`float`

`list`

`bool`

Answer explanation

`list` é uma estrutura de dados em Python que permite armazenar múltiplos elementos em uma única variável, sendo uma opção válida dentre as fornecidas.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Como você define uma função em Python?

`function myFunction():`

`def myFunction():`

`create myFunction():`

`define myFunction():`

Answer explanation

To define a function in Python, you use the 'def' keyword followed by the function name and parentheses. Therefore, the correct choice is 'def myFunction():'.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das seguintes opções é um loop em Python?

`for`

`while`

`do-while`

`foreach`

Answer explanation

`for` é um loop em Python utilizado para iterar sobre uma sequência de elementos.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual é a saída do seguinte código? ```python x = 5 y = 10 print(x + y) ```

`15`

`510`

`5`

`10`

Answer explanation

A saída correta é `15` porque o código está somando as variáveis x e y, que são 5 e 10, respectivamente.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Qual das seguintes opções é uma maneira correta de criar uma lista em Python?

`myList = [1, 2, 3]`

`myList = (1, 2, 3)`

`myList = {1, 2, 3}`

`myList = <1, 2, 3>`

Answer explanation

A lista em Python é criada utilizando colchetes [], então a opção correta é 'myList = [1, 2, 3]'.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Como você chama uma função chamada `myFunction` em Python?

`call myFunction()`

`execute myFunction()`

`myFunction()`

`run myFunction()`

Answer explanation

Em Python, para chamar uma função chamada `myFunction`, você simplesmente escreve `myFunction()` sem a necessidade de usar 'call', 'execute' ou 'run'.

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?