
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
7 questions
Estuaries and Intertidal Zones
Quiz
•
5th Grade
10 questions
QUIZ AGAMA ISLAM KELAS 3
Quiz
•
1st - 3rd Grade
10 questions
Los sentidos y sus cuidados
Quiz
•
1st Grade
11 questions
Deep Sea Gigantism
Quiz
•
3rd Grade
10 questions
NC.4.E.1.1 - Day and Night
Quiz
•
4th Grade
15 questions
Naturales
Quiz
•
3rd Grade
10 questions
Plant Parts Quiz
Quiz
•
3rd Grade
10 questions
Natural Disaster Safeguards W25
Quiz
•
2nd 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
Discover more resources for Science
20 questions
States of Matter
Quiz
•
5th Grade
6 questions
Gravity
Quiz
•
1st Grade
20 questions
3rd Grade Lost Energy
Quiz
•
3rd Grade
20 questions
Physical and Chemical Changes
Quiz
•
5th Grade
20 questions
Constructive and Destructive Forces Quiz Review
Quiz
•
5th Grade
12 questions
States of Matter
Quiz
•
3rd Grade
10 questions
Exploring Properties of Matter
Interactive video
•
1st - 5th Grade
20 questions
Human Body Systems Review
Quiz
•
5th Grade