Variables, Data Types and Keywords in Python
Variables, Data Types and Keywords in Python
3. Boolean:
Boolean (bool): Booleans represent truth values, either True
or False. They are used for logical operations and
conditions. For example, is_valid = True.
4. Set:
Sets (set): Sets are unordered collections of unique
elements enclosed in curly braces. They are useful for
mathematical operations such as union, intersection,
and difference. For example, fruits = {'apple', 'banana',
'orange'}.
5. Sequence Type:
Sequences represent a collection of elements and include
data types like strings, lists, and tuples. Strings are used to
store textual data, while lists and tuples are used to store
ordered collections of items.