Python Basics: TUPLES & SETS in Under a Minute! 🔗

preview_player
Показать описание
Python tuples and sets in under a minute: Discover how to create tuples, access their elements, create sets, add and remove elements easily. 🔗🎲

In Python, tuples are especially useful if you're trying to return data from a function in a predictable way.
Let's say I had a function called;
get_user_from_database(username)
that gets data from a database.
I can have that function return the data to the invoker as:
("Joey", 18, "programmer", "Australia", True)
This way, its basically a dictionary without the keys. It's also useful for mathematical operations!

Don't forget to like, subscribe, and leave a comment on what you want to learn next! 🔥

Join me in the PROGRAMMER'S REALM!

#Python #Programming #PythonTutorial #LearnToCode #CodingForBeginners #TheProgrammersRealm #sets #tuple
Рекомендации по теме
Комментарии
Автор

actions = ("like", "comment", "subscribe", "share")
SUBSCRIBE to join me in THE PROGRAMMERS REALM! 🚀

ProgrammersRealm
Автор

Usually superfluous, lists and dicts are what you usually need (or arrays and objects as they're called in more sensible languages)

doyouwantsli
join shbcf.ru