
Quiz de Programação em Python
Authored by Cezar Augusto Trevisan
Computers
Professional Development
10 Questions
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
`def quadrado(x): return x^2`
`def quadrado(x): return x**2`
`function quadrado(x): return x*x`
`def quadrado(x) { return x*x }`
Answer explanation
A função correta para retornar o quadrado de x em Python é `def quadrado(x): return x**2`, pois `**` é o operador de exponenciação. As outras opções estão incorretas por usar operadores ou sintaxes inválidas.
2.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
Qual é o valor de 3 * (2 + 4) // 5 em Python?
1.2
3
2
0
Answer explanation
Para calcular o valor de 3 * (2 + 4) // 5, primeiro resolvemos a expressão dentro dos parênteses: 2 + 4 = 6. Depois, multiplicamos: 3 * 6 = 18. Por fim, aplicamos a divisão inteira: 18 // 5 = 3. Portanto, a resposta correta é 2.
3.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
Qual destas é uma lista em Python?
`{1, 2, 3, 4}`
`[1, 2, 3, 4]`
`(1, 2, 3, 4)`
`<1, 2, 3, 4>`
Answer explanation
A lista em Python é definida por colchetes. Portanto, a opção `[1, 2, 3, 4]` é a única lista válida. As outras opções representam um conjunto (`{}`), uma tupla (`()`) e uma sintaxe inválida (`<>`).
4.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
Qual comando importa o módulo math em Python?
`import math`
`include math`
`using math`
`require math`
Answer explanation
O comando correto para importar o módulo math em Python é `import math`. As outras opções, como `include`, `using` e `require`, não são válidas na sintaxe do Python.
5.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
O que será impresso pelo código abaixo? ```python x = [1, 2, 3] print(x[-1]) ```
`IndexError`
Answer explanation
O código acessa o último elemento da lista 'x' usando o índice -1, que se refere ao último item. Portanto, 'x[-1]' retorna 3, que é o valor correto a ser impresso.
6.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
Como abrir o arquivo "dados.txt" para leitura em Python?
`open("dados.txt", "r")`
`open("dados.txt", "w")`
`open("dados.txt", "a")`
`open("dados.txt", "x")`
Answer explanation
A opção correta para abrir o arquivo 'dados.txt' para leitura em Python é `open("dados.txt", "r")`. As outras opções servem para escrita, anexação ou criação de arquivos, não para leitura.
7.
MULTIPLE CHOICE QUESTION
15 mins • 10 pts
Qual será a saída deste código Python? ```python for i in range(2, 7, 2): print(i, end=" ") ```
2 3 4 5 6
2 4 6
2 4
2 3 4 5
Answer explanation
O loop for com range(2, 7, 2) gera números começando em 2 até 6, com passo 2. Assim, os valores impressos são 2 e 4. Portanto, a saída correta é '2 4'.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Hàm
Quiz
•
Professional Development
15 questions
U.T. 4: Nivel de enlace - Subcapas LLC y MAC - ARP
Quiz
•
Professional Development
10 questions
Humanoid robotok
Quiz
•
1st Grade - Professio...
13 questions
Guess the Video Game Pets 1
Quiz
•
KG - Professional Dev...
11 questions
Wealth Showcases - VII
Quiz
•
Professional Development
10 questions
Khám phá máy tính lớp 5
Quiz
•
10th Grade - Professi...
10 questions
C++Quiz#1
Quiz
•
Professional Development
10 questions
all star
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
25 questions
Christmas Movies
Quiz
•
Professional Development
20 questions
Christmas Trivia
Quiz
•
Professional Development
15 questions
Fun Holiday Trivia
Quiz
•
Professional Development
25 questions
Name That Tune - Christmas
Quiz
•
Professional Development
29 questions
Christmas Song Emoji Pictionary
Quiz
•
Professional Development
9 questions
Holiday Movie Trivia
Lesson
•
Professional Development
34 questions
Winter Trivia
Quiz
•
Professional Development