Buscar

One of the main features of programming languages are vectors and matrices. In the Python language, it is possible to create vectors (one-dimension...

One of the main features of programming languages are vectors and matrices. In the Python language, it is possible to create vectors (one-dimensional lists) and matrices (multidimensional lists).

Regarding one-dimensional lists in Python, choose the correct alternative.


a. A one-dimensional list can be created by a variable that receives a set of elements separated by commas inside curly braces.
b. One-dimensional lists can be created using the term 'def list'.
c. A one-dimensional list can be created by a variable that receives a set of elements separated by commas inside square brackets.
d. One-dimensional lists are formed by only one element.
e. One-dimensional lists are formed by one or more elements that cannot be changed or deleted.

Essa pergunta também está no material:

ALGORITIMOS - SEMANA 7 - RESPOSTAS
3 pág.

Engenharia de Produção Universidade Virtual do Estado de São PauloUniversidade Virtual do Estado de São Paulo

💡 1 Resposta

User badge image

Ed Verified user icon

A alternativa correta para criar uma lista unidimensional (vetor) em Python é a opção c. Uma lista unidimensional pode ser criada atribuindo uma sequência de elementos separados por vírgulas dentro de colchetes. Por exemplo: ```python lista = [1, 2, 3, 4, 5] ``` Dessa forma, a lista `lista` terá os elementos 1, 2, 3, 4 e 5.

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