1 Odpowiedź
+ 3
When you want to store a value in a variable, depending on what you want, you have to write it differently.
x = 5 will be an int,
x = 5.0 will be a float,
x = '5' will be str,
x = [5] will be a list with an int in it.
These different shapes, that tell Python, what exactly you want, are called literals.
{5, 7} is a set literal,
{'a': 7, 'b': 12} is a dict literal,
(7, 5, 3) is a tuple literal.
A little bit clearer now?