Qual das opções abaixo define corretamente uma função em Python?
recuperacao 1 programação desenvolvimento de sistemas

Quiz
•
Other
•
12th Grade
•
Easy
SILVIO HENRIQUES PEREIRA
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
`function soma(a, b):`
`def soma(a, b):`
`fun soma(a, b):`
`define soma(a, b):`
2.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Qual das alternativas representa corretamente um laço de repetição que imprime os números de 0 a 4 em Python?
`for i in range(5): print(i)`
`for i = 0; i < 5; i++: print(i)`
`while i < 5: print(i)`
`repeat 5 times: print(i)`
3.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Qual é a principal diferença entre funções e métodos em Python?
Funções são definidas fora de classes, métodos dentro de classes.
Métodos não podem receber parâmetros.
Funções não podem retornar valores.
Não existe diferença.
4.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Em programação orientada a objetos, o que é um construtor em Python?
Um método chamado `__init__` que inicializa o objeto.
Uma função que destrói o objeto.
Um atributo da classe.
Um operador especial.
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Considere o seguinte código: ```python class Animal: def falar(self): print("Som de animal") ``` Como você cria um objeto da classe `Animal` e chama o método `falar`?
`obj = Animal(); obj.falar()`
`obj = Animal; obj.falar()`
`obj = Animal(); obj->falar()`
`obj = new Animal(); obj.falar()`
6.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Qual das alternativas representa corretamente a chamada de um método de instância em Python?
`obj.metodo()`
`obj->metodo()`
`metodo(obj)`
`obj:metodo()`
7.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Nádia está desenvolvendo um e-commerce chamado Buscante, um buscador de livros. Ela está implementando classes e objetos em Python para organizar melhor seu código e representar os livros vendidos em sua loja:
class Livro:
pass
livro1 = Livro()
Considerando que ela começa escrevendo o código acima, qual alternativa melhor descreve o funcionamento do código escrito por Nádia?
Nádia tentou criar uma função chamada Livro, mas esqueceu de definir o corpo da função.
Nádia declarou uma classe chamada Livro e depois criou um objeto chamado livro1 com a função Livro().
Nádia declarou uma classe chamada Livro e instanciou essa classe criando um objeto chamado livro1.
Nádia declarou uma classe chamada livro1 e criou uma instância chamada Livro.
Create a free account and access millions of resources
Similar Resources on Quizizz
8 questions
Transitividade Verbal 01

Quiz
•
12th Grade
10 questions
Substantivos

Quiz
•
1st - 12th Grade
12 questions
Dia das Mães

Quiz
•
3rd Grade - University
8 questions
Els instruments electròfons

Quiz
•
12th Grade
8 questions
Assuntos diversos de português

Quiz
•
12th Grade
10 questions
Ortografia - 6º ano

Quiz
•
12th Grade
12 questions
Poesia Trovadoresca - 10º ano

Quiz
•
10th Grade - University
10 questions
Rec.AV1 - Pensamento Comp. 1 ano

Quiz
•
1st Grade - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Other
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University