
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
15 questions
Experimental Design - 6th Grade
Quiz
•
5th - 8th Grade
10 questions
My community
Quiz
•
2nd Grade
15 questions
GRADE 1_FORCE AND ELECTRICITY
Quiz
•
1st Grade
10 questions
Lab Safety & Tools
Quiz
•
3rd - 4th Grade
15 questions
Review Science Grade 1
Quiz
•
1st Grade
10 questions
Conditions Necessary to Make a Bulb Light Up
Quiz
•
5th Grade
14 questions
Weather Patterns Practice
Quiz
•
4th - 6th Grade
10 questions
Animal
Quiz
•
1st - 5th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Science
20 questions
The Water Cycle
Quiz
•
5th 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
10 questions
Life Cycle of a Frog
Quiz
•
1st - 2nd Grade
20 questions
The Water Cycle
Quiz
•
4th - 5th Grade
21 questions
Solar System Review
Quiz
•
5th Grade
