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.
Pon a prueba tus conocimientos con 10 preguntas sobre 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?
Revisa el curso completo en la hoja de repaso para Python Data Handling and String Formatting.
Ver hoja de repaso →Bases de données
Bases de données
Bases de données
Programmation
Importa tu curso y la IA genera tarjetas de memoria en 30 segundos.
Generador de tarjetas de memoria