
Python - CCó
Quiz
•
Information Technology (IT)
•
University
•
Medium
CRISTINA CO
Used 2+ times
FREE Resource
23 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual função é usada para abrir um arquivo em Python para escrita, criando o arquivo se ele não existir?
open("arquivo.txt", "r")
open("arquivo.txt", "w")
open("arquivo.txt", "a")
open("arquivo.txt", "x")
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Se você quiser adicionar novos dados ao final de um arquivo sem sobrescrever o conteúdo existente, qual modo de abertura você deve usar?
"r"
"w"
"a"
"x"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual comando é usado para escrever dados em um arquivo após ele ter sido aberto para escrita?
arquivo.write("Texto")
arquivo.append("Texto")
arquivo.add("Texto")
arquivo.print("Texto")
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Ao ler um arquivo linha por linha, qual método retorna uma lista onde cada elemento é uma linha do arquivo?
arquivo.read()
arquivo.readlines()
arquivo.readline()
arquivo.splitlines()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
O que o código a seguir faz? with open("dados.txt", "r") as arquivo: conteudo = arquivo.read()
Lê o arquivo dados.txt linha por linha
Lê todo o conteúdo do arquivo dados.txt e armazena na variável conteudo
Cria um arquivo chamado dados.txt
Escreve dados no arquivo dados.txt
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual a saída do código abaixo? dados = [10, 20, 30, 40] print(sum(dados) / len(dados))
A) 25
B) 20
C) 100
D) 40
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Considere o código abaixo. Qual será a saída? texto = "Python é incrível" with open("texto.txt", "w") as arquivo: arquivo.write(texto) with open("texto.txt", "r") as arquivo: print(arquivo.read())
A) Python é incrível
B) Erro, pois o arquivo está no modo de leitura
C) texto.txt
D) Nada, pois o arquivo está vazio
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
BASE DE DATOS
Quiz
•
12th Grade - University
20 questions
HT-16 Crea ejemplos de aplicación
Quiz
•
University
18 questions
Diagnostico Grado Sexto
Quiz
•
6th Grade - University
20 questions
Kelas 8 - Halaman 27 (UH Bab 2)
Quiz
•
8th Grade - University
22 questions
ÔN TẬP CRV1
Quiz
•
6th Grade - University
20 questions
QUIZ#1 MIL GALILEE
Quiz
•
12th Grade - University
20 questions
Python Quiz Girls in ICT Day
Quiz
•
University
20 questions
SE LIGA I - 2DS - ANÁLISE E PROJETO DE SISTEMAS
Quiz
•
2nd Grade - University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
Discover more resources for Information Technology (IT)
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
22 questions
FYS 2024 Midterm Review
Quiz
•
University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
12 questions
1 Times Tables
Quiz
•
KG - University
20 questions
Disney Trivia
Quiz
•
University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
