Մոդուլներ
Quiz
•
Computers
•
11th Grade
•
Hard
Elmira Khachatryan
FREE Resource
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
MS PowerPoint
Quiz
•
11th Grade
15 questions
Computer DESKTOP - CESA
Quiz
•
7th Grade - University
15 questions
Quiz No. 1 on Open Source Software
Quiz
•
11th - 12th Grade
10 questions
TestOut Desktop Pro Plus 1.1.18 Concept Questions
Quiz
•
7th Grade - University
10 questions
Working with tables
Quiz
•
5th - 12th Grade
10 questions
Windows 7 Installation
Quiz
•
10th - 12th Grade
15 questions
Ôn tập kỳ 2 tin 6
Quiz
•
1st - 12th Grade
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
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