Dictionary comparison — method?
Use `==` for equality; `cmp()` in Python 2.
keys() — returns?
A view object of all dictionary keys.
dict() — creates?
A dictionary from sequences of key-value pairs.
KeyError — when?
Accessing a non-existent dictionary key.
String format() — purpose?
Insert variables into strings dynamically.
!r and !s — in format?
Control object representation: repr() vs str().
String repetition — operator?
The `*` operator repeats strings.
String slicing — syntax?
[start:stop:step] to extract substrings.
count() — does?
Counts occurrences of a substring in a string.
replace() — does?
Replaces substrings within a string.
open() — mode?
Specifies file access: 'r', 'w', etc.
read(n) — reads?
n characters from an open file.
readline() — reads?
A single line from a file.
try-except-else — purpose?
Handle exceptions during file operations.
Python file modes?
'r' for read, 'w' for write, 'b' for binary.
Python data types?
Int, float, string, list, tuple, dict.
Mutable data structure?
List and dict are mutable; tuple is immutable.
Set — characteristics?
Unordered, unique elements, supports set operations.
Variables — rules?
Start with letter/underscore, case-sensitive.
Functions — define with?
Using `def` keyword, reusable code blocks.
Metti alla prova le tue conoscenze con 10 domande su Python Data Handling and String Formatting.
1. How do you create a Python dictionary from a list of key-value pair tuples?
2. What is the purpose of the 'cmp()' function in Python 2 when used with dictionaries?
Ripassa il corso completo nella scheda di revisione per Python Data Handling and String Formatting.
Vedi la scheda di revisione →Bases de données
Bases de données
Bases de données
Programmation
Importa il tuo corso e l'AI genera flashcard in 30 secondi.
Generatore di flashcard