#tuples — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #tuples, aggregated by home.social.
-
Rust's tuples are not enough? Np.
🦀 **tuplers** — A crate that provides many useful tools for tuples.
🔄 e.g. map, flatten, transpose, sort, split more!
🔥 Supports no-std & WASM targets.
⭐ GitHub: https://github.com/libsugar/tuplers
#rustlang #tuples #programming #tips #tuples #library #devtools
-
Nested Tuples in Python:
Nested tuples in Python are tuples that contain other tuples as elements.
#python #tuples #NestedTuples #pythontips #learnpython #pythonprogramming #codenewbie #100DaysOfCode #pythondeveloper -
Nested Tuples in Python:
Nested tuples in Python are tuples that contain other tuples as elements.
#python #tuples #NestedTuples #pythontips #learnpython #pythonprogramming #codenewbie #100DaysOfCode #pythondeveloper -
Nested Tuples in Python:
Nested tuples in Python are tuples that contain other tuples as elements.
#python #tuples #NestedTuples #pythontips #learnpython #pythonprogramming #codenewbie #100DaysOfCode #pythondeveloper -
Tuple concatenation in Python:
Tuple concatenation in Python means combining two or more tuples using the + operator.
#python #tuples #pythontips #TupleConcatenation #codesnippet #learnpython -
Tuple concatenation in Python:
Tuple concatenation in Python means combining two or more tuples using the + operator.
#python #tuples #pythontips #TupleConcatenation #codesnippet #learnpython -
Tuple concatenation in Python:
Tuple concatenation in Python means combining two or more tuples using the + operator.
#python #tuples #pythontips #TupleConcatenation #codesnippet #learnpython -
Tuple concatenation in Python:
Tuple concatenation in Python means combining two or more tuples using the + operator.
#python #tuples #pythontips #TupleConcatenation #codesnippet #learnpython -
Tuple concatenation in Python:
Tuple concatenation in Python means combining two or more tuples using the + operator.
#python #tuples #pythontips #TupleConcatenation #codesnippet #learnpython -
Tuple Membership testing:
Tuple membership testing checks if an element exists in a tuple using the ''in'' or ''not in'' operators.
#pythoncoding #tuples #pythontips #coding #learnpython #pythonprogramming #TupleMembership #codenewbie #developerlife #100daysofcode -
It's fine for #lists - but it's not the most "#Pythonic" way to do this, at least for lists. Like some other built-in objects, lists have a method `.copy()` which does what it says - returns a #copy of the #object. That's more obvious than using `...[:]` when reading the code, so that tends to be the preferred way in Python.
Unfortunately, #tuples don't have .copy(). They do support [:]. 🤷
[...]
-
-
Quick Python Quiz - Lists vs. Tuples!
Can you explain this? What's the difference between a list and a tuple in Python?
-
Does anyone know of a Python linter which will warn when you forget the trailing comma in something which was *supposed* to be a tuple? Today's example was:
args = [("f'oo", "bar"), ("baz")]
The second item in the list ends up being a list of characters instead of a 1-element tuple. Grr.
-
@khalidabuhakmeh my vote is that the objects in #tuples in #CSharp should be PascalCase to match with the style guide for #dotnet as they're treated like properties of the object.
Once deconstructed, they're local variables and would get camelCase.
-
@benjiyork Okay. So I use #Tuples as a return from a function if there is more than one value (like a vector). Got it! Thank you :blobnerd:
-
I’ll be mostly posting about #Python in the data analysis and science and related domains here…
…but for those learning to code, whatever the final aim, it’s good to get a broad perspective
So here’s something different to learn about or consolidate the key data structures in Python - lists, tuples, dictionaries, and sets
Here’s the link to the article for those who want a “diversion” from more serious-looking exercises!
https://thepythoncodingbook.com/2021/10/31/using-lists-tuples-dictionaries-and-sets-in-python/
#Python #Programming #Coding #Lists #Dictionaries #Tuples #Sets #DataStructures
-
The common solution in the #java #programming #language is not to return #tuples at all. Instead, we expect the programmer to create a custom data type which holds and can access a tuple's elements as strongly, statically typed class instance fields.
This is normal, for java.
It's also a lot of work.
It's verbose, repetitive, and each type requires a ton of testing, which is equally verbose and repetitive.
Time for java to embrace tuples!