You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tuples are immutable but we can:
1. Convert the tuple to a list
2. Reasign values (edit content)
3. Convert list back into a tuple
This works because they are same length.
It's the same as just overwriting the tuple.
✨Challenge 2:
What is the relationship among the following values: len(set1) == ( len(set3) + len(set5) )
Aquí te pedía relaciones entre los sets. Te dejo un ejemplo. Si lo ejecutas te tendría que salir True:) En tu caso: set1(80) = set3(38) + set5(42)
Check if set1 contains set2 using the Python Set issubset method. Then check if set1 contains set3.*
Using the pop method, remove the first element from set1.
set1_list = list(set1)
set1_list.pop(0)
set1_list_pop = set(set1_list) # And we convert it back to a set
print(set1_list_pop)
The pop method removes an element randomly, thus we could convert it to list to pop the first element.
Remove every element in the following list from set1 if they are present in the set. Print the remaining elements.
remaining_elem = []
list_to_remove = [1, 9, 11, 19, 21, 29, 31, 39, 41, 49, 51, 59, 61, 69, 71, 79, 81, 89, 91, 99]
for i in set1:
if i not in list_to_remove:
remaining_elem.append(i)
print(remaining_elem)
✨Challenge 3: Impecable, nada a añadir.
sigue así!!! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.