
dict quiy
Quiz
•
Science
•
1st - 5th Grade
•
Practice Problem
•
Medium
mwdh8ch2x9 apple_user
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Mi a kimenete a következő kódnak?
my_dict = {"a": 1, "b": 2, "c": 3}
print(len(my_dict))
6
3
hiba
1
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Melyik kód adna hozzá egy új kulcs-érték párt a my_dict nevű szótárhoz, ahol a kulcs "d" és az érték 4?
my_dict = {"a": 1, "b": 2}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Mi történik, ha egy nem létező kulcsot próbálunk elérni egy szótárban?
my_dict = {"apple": "red", "banana": "yellow"}
print(my_dict["grape"])
Visszaadja a None értéket.
Hibaüzenetet (KeyError) dob.
Hozzáadja a "grape" kulcsot None értékkel.
Visszaad egy üres stringet.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Melyik metódus adja vissza egy szótár összes kulcsát?
values()
items()
keys()
get_keys()get_keys()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
my_dict = {"x": 10, "y": 20, "z": 30}
for key, value in my_dict.items():
print(f"{key}: {value}")
x: 10
y: 20
z: 30
x
y
z
10
20
30
hiba
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Hogyan lehet törölni a "banana" kulcsot és a hozzá tartozó értéket a következő szótárból?
fruits = {"apple": 1, "banana": 2, "orange": 3}
fruits.remove("banana")
del fruits["banana"]
fruits.delete("banana")
fruits.pop_key("banana")
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Melyik állítás igaz a Python szótárak kulcsaira vonatkozóan?
A kulcsoknak egyedinek kell lenniük.
A kulcsoknak módosíthatónak kell lenniük (mutable).
A kulcsok csak stringek lehetnek.
A kulcsok tetszőleges számú értéket tárolhatnak
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
Soil Erosion
Quiz
•
5th Grade
12 questions
Magnets
Quiz
•
4th Grade
15 questions
review 11 new
Quiz
•
1st Grade
15 questions
Animals wild and domestic
Quiz
•
2nd Grade
8 questions
TABLA PERIODICA
Quiz
•
1st - 12th Grade
12 questions
Mythical Creatures: Big Foot
Quiz
•
3rd Grade
11 questions
UJI MAKANAN
Quiz
•
2nd Grade
13 questions
F3 electricity
Quiz
•
3rd Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Science
15 questions
Earthly Ecosystems Unit Review
Quiz
•
3rd Grade
20 questions
Weathering, Erosion, Deposition
Quiz
•
5th Grade
15 questions
Physical and Chemical Changes
Quiz
•
4th Grade
20 questions
Food Chains and Food Webs Review
Quiz
•
5th Grade
28 questions
4th Grade The Need for Speed
Quiz
•
3rd - 5th Grade
11 questions
Unit 7 Science Review: Our Solar System
Quiz
•
3rd Grade
20 questions
The Water Cycle
Quiz
•
4th - 5th Grade
21 questions
Solar System Review
Quiz
•
5th Grade
