Lecture 5 (Datatypes overview)
Lecture 5 (Datatypes overview)
🎥 Reference
Python is dynamically typed, meaning you don't need to declare the data type
of a variable.
Data types determine the kind of operations that can be done on a value.
Python supports multiple built-in data types.
🔢 Numbers
print(2 ** 100)
🧵 Strings
s = "Python"
print(s[0]) # 'P'
print(s[-1]) # 'n'
📃 Lists
Code:
🔐 Tuples
Like lists, but immutable — once created, their elements can’t be changed.
Use parentheses () to define:
Code:
📖 Dictionaries
Code:
🧠 Bonus Concepts
Python allows operations with large numbers, negative indices, and dynamic
typing.
Lists, tuples, and dictionaries are core to storing structured data in Python.
Strings and tuples are immutable; lists and dictionaries are mutable.