Հարց 1․ CSV ֆայլի ընթերցման ճիշտ ձևը
Ունենք data.csv ֆայլ, և այն ցանկանում ենք կարդալ։ Ո՞ր կոդն է ճիշտ։
Մոդուլներ
Quiz
•
Computers
•
11th Grade
•
Hard
Elmira Khachatryan
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Ունենք data.csv ֆայլ, և այն ցանկանում ենք կարդալ։ Ո՞ր կոդն է ճիշտ։
B)
import csv
with open("data.csv", "r") as file:
reader = csv.reader(file)
for row in reader:
print(row)
C)
import csv
reader = csv.reader("data.csv")
for row in reader:
print(row)
2.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
A) Կարդում է CSV ֆայլը և վերադարձնում տողերը ցուցակների տեսքով
B) Վերադարձնում է CSV ֆայլը որպես տեքստ
C) Գրում է տվյալները CSV ֆայլի մեջ
D) Վերածում է CSV ֆայլը tst-ի
3.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Ունենք հետևյալ տվյալները, որոնք ցանկանում ենք գրանցել products.csv ֆայլում․
Product,Price
Apple,100
Banana,50
Ո՞ր կոդն է ճիշտ։
A)
import csv
with open("products.csv", "w") as file:
file.write("Product,Price\nApple,100\nBanana,50")
B)
import csv
with open("products.csv", "w", newline="") as file:
writer = csv.writer(file)
writer.writerow(["Product", "Price"])
writer.writerow(["Apple", 100])
writer.writerow(["Banana", 50])
C)
import csv
with open("products.csv", "w") as file:
writer = csv.reader(file)
writer.writerow(["Product", "Price"])
writer.writerow(["Apple", 100])
writer.writerow(["Banana", 50])
4.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
A)
with open("data.csv", "a") as file:
writer = csv.writer(file)
writer.writerow(["New", "Data"])
B)
with open("data.csv", "w") as file:
writer = csv.writer(file)
writer.writerow(["New", "Data"])
C)
with open("data.csv", "r") as file:
writer = csv.writer(file)
writer.writerow(["New", "Data"])
5.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
A) Ցուցակների ցուցակ
B) Բառարանների ցուցակ, որտեղ բանալիները (keys) CSV ֆայլի վերնագրերն են
C) Պարզ տեքստային տվյալներ
6.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Name,Age,Grade
Anna,16,A
David,17,B
Emma,15,A
import csv
with open("students.csv", "r") as file:
reader = csv.DictReader(file)
for row in reader:
print(row["Name"])
A)
['Anna', 'David', 'Emma']
B)
Anna
David
Emma
C)
{'Name': 'Anna', 'Age': '16', 'Grade': 'A'}
{'Name': 'David', 'Age': '17', 'Grade': 'B'}
{'Name': 'Emma', 'Age': '15', 'Grade': 'A'}
7.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
A) Որպեսզի չստանանք կրկնակի դատարկ տողեր
B) Որպեսզի ֆայլը չվնասվի
C) Որպեսզի տվյալները ճիշտ կոդավորվեն
D) Որպեսզի ֆայլը ճիշտ ընթերցվի csv.reader()-ով
10 questions
uji materi Informatika kelas 8 bab 3 TIK
Quiz
•
8th Grade - University
12 questions
Text File Pop Quiz
Quiz
•
11th Grade
10 questions
Information Processing - File Organization/Access
Quiz
•
10th - 11th Grade
10 questions
Multimedia Elements
Quiz
•
10th - 12th Grade
14 questions
Files e Tokens
Quiz
•
11th Grade
10 questions
Wrażenia globlne w Linxie
Quiz
•
10th Grade - University
15 questions
File Management
Quiz
•
9th - 12th Grade
8 questions
Generic file types
Quiz
•
7th - 11th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade