Մոդուլներ
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Elmira Khachatryan
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Հարց 1․ CSV ֆայլի ընթերցման ճիշտ ձևը
Ունենք 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
Հարց 2․ Ինչ է անում csv.reader()-ը?
A) Կարդում է CSV ֆայլը և վերադարձնում տողերը ցուցակների տեսքով
B) Վերադարձնում է CSV ֆայլը որպես տեքստ
C) Գրում է տվյալները CSV ֆայլի մեջ
D) Վերածում է CSV ֆայլը tst-ի
3.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Հարց 3․ CSV ֆայլի գրանցման ճիշտ եղանակը
Ունենք հետևյալ տվյալները, որոնք ցանկանում ենք գրանցել 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
Հարց 4․ Ինչպե՞ս ավելացնել նոր տվյալներ առկա CSV ֆայլում (append ռեժիմով)
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
Հարց 5․ Ինչ է վերադարձնում csv.DictReader()-ը?
A) Ցուցակների ցուցակ
B) Բառարանների ցուցակ, որտեղ բանալիները (keys) CSV ֆայլի վերնագրերն են
C) Պարզ տեքստային տվյալներ
6.
MULTIPLE CHOICE QUESTION
30 sec • Ungraded
Հարց 6․ Ի՞նչ կտպի այս կոդը, եթե students.csv ֆայլը հետևյալն է․
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
Հարց 7․ Ինչու ենք օգտագործում newline="" արգումենտը open() ֆունկցիայում CSV ֆայլ գրելիս?
A) Որպեսզի չստանանք կրկնակի դատարկ տողեր
B) Որպեսզի ֆայլը չվնասվի
C) Որպեսզի տվյալները ճիշտ կոդավորվեն
D) Որպեսզի ֆայլը ճիշտ ընթերցվի csv.reader()-ով
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
Already have an account?
Similar Resources on Wayground
14 questions
Perintah Dasar Linux 1
Quiz
•
11th Grade
10 questions
INFORMATIKA QUIZZ
Quiz
•
7th Grade - University
8 questions
Gathering Evidence
Quiz
•
9th - 12th Grade
12 questions
Компютърна графика
Quiz
•
5th - 12th Grade
15 questions
Quis Grade 5
Quiz
•
9th - 12th Grade
15 questions
Data Analysis Pop Quiz
Quiz
•
11th Grade
12 questions
File dan Folder
Quiz
•
9th - 12th Grade
10 questions
Supplement Lesson in Sound, Video and Publishing
Quiz
•
11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd 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
