
dict quiy
Quiz
•
Science
•
1st - 5th Grade
•
Medium

mwdh8ch2x9 apple_user
Used 2+ times
FREE Resource
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
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
The story of Amrita
Quiz
•
4th Grade
15 questions
Leaves around us
Quiz
•
3rd - 4th Grade
10 questions
Year 5 Science Revision
Quiz
•
5th - 6th Grade
10 questions
Class -1
Quiz
•
1st Grade
15 questions
Plant Classification
Quiz
•
5th Grade
10 questions
Hygiene and Nutrition
Quiz
•
1st - 2nd Grade
12 questions
Moon Phases Review
Quiz
•
5th Grade
10 questions
2. A Snake Charmer's story
Quiz
•
5th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Science
20 questions
States of Matter
Quiz
•
5th Grade
15 questions
Review: Properties of Matter
Quiz
•
5th Grade
20 questions
Physical and Chemical Changes
Quiz
•
5th Grade
18 questions
Force and Motion Test
Quiz
•
5th Grade
20 questions
Constructive and Destructive Forces Quiz Review
Quiz
•
5th Grade
12 questions
States of Matter
Quiz
•
3rd Grade
15 questions
Mixtures and Solutions Formative
Quiz
•
4th Grade
19 questions
Force and Motion
Quiz
•
3rd Grade