Afiz โšก๏ธ
Afiz โšก๏ธ

@itsafiz

8 Tweets 2 reads Dec 13, 2022
NamedTuples in Python (with code samples)
namedtuples allow us to give names to each element in the tuple. We can iterate through named tuples either by index or key
A Thread ๐Ÿงต๐Ÿ‘‡
1. import namedtuples from collections module
2. Create a named tuple to represent the Student
3. Create Objects of Student Named Tuple
4. Access Student information using keys
5. Access Student information using the index
Find the complete source code in this repo:
github.com
I hope you like this content!
I create content around Python, NLP and ML.
Follow me at @itsafiz, if you don't want to miss anything.
RT ๐Ÿ” and Like โค๏ธ the first tweet for better reach!
Cheers ๐ŸŽ‰

Loading suggestions...