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.
Тествайте знанията си с 10 въпроса по 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?
Прегледайте пълния курс в листа за преговор за Python Data Handling and String Formatting.
Вижте листа за преговор →Bases de données
Bases de données
Bases de données
Programmation
Импортирайте курса си и AI генерира флашкарти за 30 секунди.
Генератор на флашкарти